Oct 04 2011

How to detect mouse over / out on href links?

Category: AS3,TextAreaadmin @ 12:47 am

Introduction to com.doitflash.text.TextArea (Part 3)

You’re able to use basic CSS for styling your HTML content being used in TextFields via the htmlText property. you can change the color, size or put an underline when rolling over an href link in TextField.

it’s good and makes your content look better, but what if you want to call a custom function when you mouse over a link? what if, I donno, what if you have a tooltip enabled in your project and wish to show a tooltip window when you mouse over a specefic link in your text block?

TextArea is here to help you with that! with a little change in your html content and you will be able to call custom functions inside your text blocks.

If you have not downloaded the TextArea class yet > http://doitflash.com/, download it now. install the classes in your class path and try the following sample code below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import flash.text.TextFieldAutoSize;
import com.doitflash.text.TextArea;
     
var _textArea:TextArea = new TextArea();
_textArea.condenseWhite = true;
_textArea.autoSize = TextFieldAutoSize.LEFT;
_textArea.embedFonts = false;
_textArea.border = true;
     
_textArea.holder = this;
_textArea.client = this; // must be where you have your 'allowed functions' saved
_textArea.funcSecurity = true;
_textArea.allowedFunctions(myCustomFunction, funcOnOver, funcOnOut);
_textArea.mouseRollOverEnabled = true;
_textArea.fmlText = "<p>This is a <a href='event:myCustomFunction();onMouseOver:funcOnOver();onMouseOut:funcOnOut()'>link</a>.</p>";
     
this.addChild(_textArea);
     
function myCustomFunction():void
{
     trace("custome function");
}
function funcOnOver():void
{
     trace("rollOver text = " + _textArea.rolledOverText);
     trace("rollOver url = " + _textArea.rolledOverUrl);
}
function funcOnOut():void
{
     trace("rollOut");
}

Tags: , , , , , , , , , ,


Oct 03 2011

how to load animated gif inside text field?

Category: AS3,TextAreaadmin @ 3:02 am

Introduction to com.doitflash.text.TextArea (Part 2)

it’s easy to load external images into your text fields, you just use the native img tag like below and it will load and be shown inside your text block.

1
<img src="image.gif" alt="" width="150" height="150" align="left" />

I’m not going to talk about how you initialize the TextField class and then set the htmlText property of it, it’s easy and there are millions of samples on the net to show you how you can create a TextField instance to load external data.

what I’m going to talk about in this post is how you can load animated gif files inside your Text field! because trying to load a gif file in TextField will just result in showing the first frame of the gif file. follow steps below and you will be able to load and play external animated gif files in no time.

You need to have downloaded the TextArea class > http://doitflash.com/
You should also have downloaded the image module > http://doitflash.com/?portfolio_mod=image-module

Downloading a module package means you will be able to use a new tag in your text field. to use a new tag you need the tag’s module swf file and the module package has all the files you need to compile the required swf file.

so, after downloading the image module package, go to “Src” folder to create the “TextModule_image.swf” file. leave this file for a while and we’ll get back to it a bit later.

now, open your AS3 project and insert this code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import flash.text.TextFieldAutoSize;
import com.doitflash.text.TextArea;
     
var _textArea:TextArea = new TextArea();
_textArea.condenseWhite = true;
_textArea.autoSize = TextFieldAutoSize.LEFT;
_textArea.embedFonts = false;
_textArea.border = true;
_textArea.multiline = true;
_textArea.wordWrap = true;
_textArea.width = 200;

_textArea.holder = this;
_textArea.client = this;
_textArea.assetsPath = "assets/"; // where you have stored your module swf files
_textArea.fmlText = "load an image with the \"image\" tag: <image src='image.gif' width='140' height='140' align='left' id='id1' />";
     
this.addChild(_textArea);

Using TextArea instead of the classic TextField is the key and as you see in the above sample, you initialize and use the TextArea class just like how you used to work with TextField, the only changes are that you are setting the location of your module swf files with the “assetsPath” property and you use the “fmlText” rather than the classic “htmlText”.

the assets path is the location where you will store all your tag swf modules.

I hope this has been helpful.

Tags: , , , , , , ,


Jul 03 2010

Deeplinking brick gallery class

Category: galleryadmin @ 11:00 pm

Dynamic Gallery Class.

  • To be used in flash projects.
  • To be embedded directly in HTML pages.
  • Supports deep linking.
  • Auto resizing
  • XML driven

For developers (professional users), you can initialize the gallery class and set its properties through coding.
For other users, you can just take a look at our sample files and install the gallery then use the xml to set your own photos.

CHECK OUT THE DEMO HERE

Images being used in the preview has been bought from fotolia and they are NOT included in the purchased package.

DOCUMENTATION

Read the gallery Documentation here. or download them for your offline review here.

BUY NOW

Check soon…

Regards
Hadi

Tags: , , , , , , , , , ,


Apr 28 2010

dropdownMenu Class

Category: Utilsadmin @ 10:24 pm

Totally dynamic combo menu / dropdown menu. you can initialize it and set its inputs. items in the menu are created with an xml, each item can have a different size or color or font… Another nice thing about this class is that it’s thoughtfully extend-able!

CHECK OUT THE DEMO HERE

Continue reading “dropdownMenu Class”

Tags: , , , ,


Apr 20 2010

Free AS3 Scrollbar Class

Category: Free Filesadmin @ 5:10 pm


I did a couple of searches around and I found out that you can’t easily find a free and good looking scrollbar class which supports Horizontal and Vertical scrolling both at the same time! so I decided to build one :)

then it turned out that it actually does even more than just scrolling horizontally and vertically!!! you can control everything also.

Here are the features of this class:

  • supports horizontal and vertical scrollers individually or you can use them both at the same time
  • the main class itself is extending MovieClip and you can simply add it to anywhere you’d like
  • the content to be scrolled, can be anything, text, html text, an image, a video file, sprite, shape, movieclip, whatever!
  • the scroll has a smooth movement and the speed is customizable
  • mouse wheel is supported
  • the scroller design can be easily modified for your own uses
  • live and runtime scroll support (if your content extends in the runtime, the scrollbar will fix itself to the new dimensions automatically)

Continue reading “Free AS3 Scrollbar Class”

Tags: , , , , , , , ,


Feb 21 2010

Getting started with AS3 as soon as possible

Category: tutorialali @ 9:20 am

Hi everybody,

I know how felt for the first time that you wanted to start learning AS3! specially when you were not familiar with any other languages before.

Alright, now it’s time for you to be relax that you have found a quick post finally to get you started with AS3 as soon as possible.

I myself when I was starting to learn about AS3, I found it so hard to get started… I had to spend so much time on finding different books, video tutorials, etc… and hehe, it was just the beginning, then I had to start studying the books and watching the videos… you know? it takes so much time for you to get started like that, but in the other hand it’s good for those who are not also familiar with using Adobe flash interface, etc… in the following I let you know whose this tutorial is for.

WHOSE THIS TUTORIAL IS FOR?

This tutorial is good for those who know a little about Adobe flash interface and don’t know anything about AS3 but know a little about computer languages and are a little familiar with variables, functions, etc… and love to get familiar with the AS3 world and don’t know where to start! so they don’t want to waste their times on seeing the tutorials that explain functions and variables from the beginning and explain every littile tiny thing from scratch… they need to have a resource for them to get them as soon as possible on their ways, so that’s why this post is written by me.

Alright, so for those who doesn’t know anything about Adobe flash interface or something and like to study some books and watch video tutorials, there are a dozens of books and videos out there to put you on your way but here I just want to mention the main facts. Continue reading “Getting started with AS3 as soon as possible”

Tags: , , , , , , , , , , , , , , , , ,


Feb 21 2010

Custom Event Listener

Category: AS3admin @ 2:22 am

When writting your AS3 projects, you will need events. The main thing that events do is to help you make a bridge between your instances of classes. take the adobe’s MouseEvent as an example. you add a MouseEvent.CLICK listener to a movieclip so that when you click on a movieclip instance it will dispatch the “CLICK” event. it works like below as you know.

import flash.events.MouseEvent;
mc.addEventListener(MouseEvent.CLICK, onClick);
function onClick(e:MouseEvent):void
{
    trace("mc is clicked")
}

this is all good, you have used an event being built by adobe (there are many other premade events by flash if you just check the package flash.events) Continue reading “Custom Event Listener”

Tags: , , , , , , ,


Feb 21 2010

generate asDoc for flash player 10

Category: AS3admin @ 12:07 am

in my other post about asDoc generating I talked about my expiriences in generating asDoc but that string in the .bat file works only for flash player 9 projects! in this artical I will talk about how you ca also generate asDoc successfully for flash player 10 codes also.

first read the last post here to get ready with the whole idea. http://www.myflashlab.com/2010/02/20/how-to-generate-asdoc-from-your-class-files/

the only modification you need to make to the .bat file is:
-external-library-path “C:\Program Files\Adobe\flex_sdk_4.0.0.6898\frameworks\libs\player\10″ Continue reading “generate asDoc for flash player 10″

Tags: , , , , , , , , , ,


Feb 20 2010

how to generate asDoc from your class files

Category: AS3admin @ 11:49 pm

With the launch of our new website, this site, myflashlab.com, I tried to help users use our classes with a better expirience and that was when I thought of generating adobe like AS API documentations!

to tell you the truth, at first I did not know that there’s a tool to automatically generate these nice looking documents! so the first document I generated was done totally manually with my DreamWeaver! it took a lot of time, there were so many broken links between the pages and it finally gave me a feeling that made me say, how crazy adobe is to be building these documents!

After being almost disappinted, I noticed that some open source programmes like paperVision or some other have the very same looking documentations! so I was suspisous that there must be a tool for doing this time consuming work and I was right, there is a nice tool and it’s called asDoc generator :)

In this post I will talk about my own expiriences on how I managed to generate the documentations I needed for my classes. there may be better approaches that I’m not aware of. but this is what is working for me and I am happy with. If you have a better idea or something, please share it with us. Continue reading “how to generate asDoc from your class files”

Tags: , , , , , , , , ,


Jan 27 2010

Flip Class – CornerFlip

Category: Utilsadmin @ 6:58 pm

This flip effect class works dynamically and is created through pure coding. There is NO library assets or symbols or what soever. you can simply initialize the class and set which corner of your project you want to have the flip effect and it will just work like charm!

CHECK OUT THE DEMO HERE

You can add this paper flip effect to any display object, any MovieClip, stage or anywhere. below is a sample code showing the different settings that you can have for your CornerFlip class: Continue reading “Flip Class – CornerFlip”

Tags: , , , , , , , ,


Next Page »