You may have noticed the HTML check box in the Text Options Panel. With Flash 5, you can now use HTML formatting tags within Input and Dynamic Text fields! In Flash 4 movies, you could not specify more than one set of formatting specifications for any text field. For example, if you created a text field that used black-colored Verdana text at 18 points in faux bold, then you could not insert any other typeface, color or size in that text field. With Flash 5, you can use <FONT> tags to specify multiple typefaces, colors, styles, and sizes within one text field. You can also use <A HREF> tags to link to internal Flash functions or external URLs!
Supported HTML tags
You can use the following HTML tags to format your Flash text fields. You can insert these tags into ActionScript variable values, or you can apply them (without knowing or writing the syntax) using the Character and Text Options Panels.
Font and paragraph styles
The basic <FONT> and physical “faux” styles for text (bold, italic, and underline) can be applied to Flash text.
URL and ActionScript Linking
You can use the <A> tag with the HREF attribute to apply URL links within Flash text. You can also specify a TARGET attribute for the <A> tag. The TARGET attribute determines which browser window or frame will display the URL link in the HREF attribute. As with regular HTML, You can use the default _top, _parent, _self, or _blank values, as described for the getURL action. Later in this section we see how you can also execute internal Flash functions from <A HEF> tags.
Formatting text with the Character and Text Options Panel
You don’t necessarily need to write out HTML tags to apply them to your Flash text. You can use the Character Panel to assign HTML formatting to all Text types (for example, Static, Input, and Dynamic). For Input and Dynamic Text fields, you will need to use the Text Options Panel to enable HTML formatting, by checking the HTML option. In this section, we demonstrate the use of HTML formatting within Static and Dynamic Text fields.
You can selectively change text within one text block or field.
URL-linked text appears with dashed underlines. You will not see this dashed underline in the actual .SWF file.
Inserting HTML tags into Text Fields with ActionScript
In this section, we continue with the previous example that you created in the last section. We convert the Static Text block into a Dynamic Text field, and manipulate the formatting with ActionScript.
You can observe the proper ActionScript syntax for HTML formatting in the Output window. Note that any quotes around values of tag attributes are preceded by a backslash, as in <FONT FACE=”verdana”>. Because the value of book is already a string data type surrounded by quotes, any internal quotes need to be declared with a backslash character.
This code should appear as one line of code in the Actions list of the Actions Panel.
By using other ActionScript variables and methods, you can apply specific text formatting to external data sources that have been loaded into the Flash movie, such as database records or lists. In the next section, you learn how to execute Flash functions from HTML-formatted text fields.
Using asfunction in <A HREF> tags
Not only can you use HTML formatting in Flash text, but you can also execute Flash actions from your text fields, using the <A> tag and a HREF attribute value of asfunction:function,argument. For example, if you wanted to link text to a function that loads a new Flash .SWF into a Movie Clip target, you can create a custom function that uses the loadMovie action and reference that action from your <A HREF> tag for a text field. See the following code (note that the ¬ indicates a continuation of the same line of code; do not insert this character into your actual code):
In this code example, the text within the <A></A> tags will execute the myMovie function, passing the string movie.swf as the name argument.
If you need to pass more than one argument, then you will need to use send all the values as one string separated by a comma (or preferred character). Then, you would use the split method as follows (note that the ¬ indicates a continuation of the same line of code; do not insert this character into your actual code):
In this example, the myMovie function takes the name argument and creates an array with the split method. This array’s name is tempArgs. The elements of the tempArgs array are the two string values separated by a comma in the myArgs variable.
Flash Related Interview Questions
|Adv Java Interview Questions||J2EE Interview Questions|
|Adobe Flex 3 Interview Questions||Dreamweaver Interview Questions|
|3D Animation Interview Questions||Adobe Flash CS6 Interview Questions|
|Dreamweaver CS3 Interview Questions||Adobe Flex Interview Questions|
|Adobe Flex Actionscript Interview Questions||Gif Animation Interview Questions|
|Adobe Fireworks Interview Questions|
Understanding The Flash Framework
Exploring The Interface: Panels, Settings, And More
Using Tools For Navigation And Viewing
Working With Selections And The Pen Tool
Working With The Drawing And Painting Tools
Working With Text
Exploring The Timeline
Checking Out The Library: Symbols And Instances
Drawing In Flash
Animating In Flash
Using Bitmaps And Other Media With Flash
Designing Interfaces And Interface Elements
Understanding Sound For Flash
Importing And Editing Sounds In Flash
Optimizing Flash Sound For Export
Understanding Actions And Event Handlers
Navigating Flash Timelines
Controlling Movie Clips
Sharing And Loading Assets
Planning Code Structures
Creating Subroutines And Manipulating Data
Understanding Movie Clips As Complex Objects
Sending Data In And Out Of Flash
Understanding Html And Text Field Functions In Flash
What Is Generator?
Revving Up Generator
Working With Third-party, Server-side Applications
Working With Raster Graphics
Working With Vector Graphics
Working With Audio Applications
Working With 3d Graphics
Working With Quicktime
Working With Realplayer
Creating Full-motion Video With Flash
Creating Cartoon Animation With Flash
Planning Flash Production With Flowcharting Software
Working With Authoring Applications
Publishing Flash Movies
Integrating Flash Content With Html
Using Players, Projectors, And Screensaver Utilities
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.