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: , , , , , , ,


Sep 30 2011

What is TextArea and why/where to use it?

Category: AS3,TextAreaadmin @ 11:10 pm

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

Have you ever wished you could detect mouse rollover/rollout on href links inside your TextFields?
Have you ever tried to load an animated gif file but were disappointed to see animated gif files are not supported with the img tag?
Have you ever wished to load an external swf inside your TextField and be able to interact with it?
Have you ever happened to need to call custom functions in your AS3 project from your text field links and be able to pass arguments with it?

You may be surprised to know that with the original TextField class from adobe, you can make all wishes above come true! but doing them all will take a bloody long time and there are many small facts that you should be aware of before you can do all these stuff with TextField. I’m talking about little facts that there are no documents about them anywhere on the net.

to save time, you could easily use the new TextArea class. TextArea can be a full alternative to TextField and working with it is just exactly similar to how you work with TextField. it’s just that it does some more stuff than TextField which will solve all the questions above.

check out the demo here: http://doitflash.com/demo/main/ here you’ll find all the powers of TextArea.

to start using TextArea, download it for free from here: http://www.doitflash.com/ then copy the classes to your class paths and replace the TextField with TextArea everywhere in your project! replacing TextField with TextArea will not change any behavior in your projects :)

read documentation there and you will see how you can use the new features. in my next posts I will try to talk more about TextArea and how you can solve the above questions.

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


Aug 03 2010

Free AS2 Server Side Counter

Category: Utilsadmin @ 4:48 am

This file uses php to save the server time and you also set the end time and that’s all. just open the index.php file and see the setting there. I hope you enjoy it. see the preview below.

Download Now:

Enter your name and email address, the download link will be sent to your email.

We do NOT share your information with any third party. This is promised.





Enjoy using it.
Regards,
Hadi


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: , , , , , , , , , ,


May 31 2010

AS3 Twitter App, user timeline

Category: Utilsadmin @ 10:37 pm

Have Tweets on your flash website! with this AS3 class you can show your latest tweets. the class has been coded with careful OOP standards, you may use it in flash, flex and flashDevelop projects.

CHECK OUT THE DEMO HERE

Continue reading “AS3 Twitter App, user timeline”

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: , , , , , , , ,


Mar 07 2010

100% HTML table

Category: tutorialali @ 12:38 am

Hi,

Maybe you have tried so hard to create a HTML table with 100% width and height in Dreamweaver but anytime you tried you have seen that width of the table is 100% but not the height!!

If you try to write this simple HTML file with notepad yourself you see that it’s easy and you did it! and every thing works just fine… but when you create a new HTML file in Dreamweaver and try to make your table 100% you have a problem!
Continue reading “100% HTML table”

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: , , , , , , , , , , , , , , , , ,


Next Page »