E-merald web-engineering Flash components
E-merald web-engineering Contact Site map
 
Home Components Support Purchase
Components

Creating an application

The following procedure explains how to add Dynamic Radio Button components to an application while authoring.

Example 1

In this example, the dynamic radio buttons are used to create the main animated menu for a Flash application.

To create an application with the Dynamic Radio Button component:

1. Set the Stage size to 500 x 300 pixels and leave white as background color. For frame rate enter any appropriate value — for example, 30 fps.
2. Drag one Dynamic Radio Button component from the Components panel to the Stage and set its coordinates to (10, 35).
Note: Although the default size for a Dynamic Radio Button instance is 100 x 70 pixels, the visual area actually increases vertically up to 150% while effect duration.
3. In the Component inspector, do the following:

For the icon color parameters, set:

iconColor  #669999
iconColorSelected  #FF9900

For the fontNormalStyle, fontOverStyle and fontSelectedStyle parameters as the objects, set the following values (from left to right accordingly):

Leave the other parameters without changes.

4. Make three copies of the current Dynamic Radio Button instance and set their coordinates to (110, 35), (210, 35) and (310, 35) accordingly.
5. Set the Label parameter for the component instances accordingly to "Home", "Products", "Support", "Contact".
6. Select one of the dynamic radio buttons on the Stage — for example, "Home" — and set the selected parameter to true.
7. Select Control > Test Movie.

You can view the completed application here.

Example 2

In this example, the dynamic radio buttons are used to create the main Flash menu as SWF file embedded in HTML pages.

To create an application with the Dynamic Radio Button component:

1. Set the Stage size to 500 x 300 pixels and leave white as background color. For frame rate enter any appropriate value — for example, 30 fps.
2. Drag one Dynamic Radio Button component from the Components panel to the Stage and set its coordinates to (10, 40).
3. In the Component inspector, do the following:
For the animationEffect parameter, set:  Circulation
For the animationIconSet parameter, set:  set2
For the fontNormalStyle parameters, set:
fontColor  0x000000
For the fontOverStyle and fontSelectedStyle parameters, set:
fontColor  0x990000
textDecoration  underline
For the icon color parameters, set:
iconColor  #FF6600
iconColorSelected  #666666
For the groupName parameter, set  topMenu
For the URL parameters, set:
window  _self
delay  800

Leave the other parameters without changes.

4. Make three copies of the current Dynamic Radio Button instance and set their coordinates to (110, 40), (210, 40) and (310, 40) accordingly.
5. Set the Label parameter for the component instances accordingly to "Home", "Documentation", "Projects", "Archive".
6. In the Property inspector, enter values m1, m2, m3 and m4 for the Instance Name property of the component instances.
7. Select one of the dynamic radio buttons on the Stage — for example, "Home" — and set the selected parameter to true.
8. For the URL parameters in the Component inspector, set the following values of the url property:
for m1 instance  home.html
for m2 instance  documentation.html
for m3 instance  projects.html
for m4 instance  archive.html
9. Place the following code in the first frame of the movie:
topMenu.selection = eval(menu_item);
10. Publish the Flash document with appropriate name — for example, top_menu.swf.
11. Create four HTML pages with the file names: home.html, documentation.html, projects.html and archive.html and place them to the same folder that contains top_menu.swf.
12. Place the following HTML code sample into home.html to embed SWF file (in our case, top_menu.swf):

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="500" height="300" id="top_menu" align="middle">
<param name="allowScriptAccess" value="sameDomain"/>
<param name="movie" value=" top_menu.swf?menu_item=m1"/>
<param name="quality" value="high"/>
<param name="bgcolor" value="#ffffff"/>
<embed src=" top_menu.swf?menu_item=m1" quality="high" bgcolor="#ffffff" width="500" height="300" name=" top_menu" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>
</object>

For the files documentation.html, projects.html and archive.html, the values of menu_item variable must be "m2", "m3" and "m4" accordingly.

13. Open one of created HTML files in a web browser and test the behavior of the Dynamic Radio Button component. You can view the completed application here.
© E-MERALD. All rights reserved.
© Designed by Fox.net.ua.