Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:How to attach symbols dynamically in ActionScript 2.0

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

We do not recommend Flash Lite development on current Nokia devices, and all Flash Lite articles on this wiki have been archived. Flash Lite has been removed from all Nokia Asha and recent Series 40 devices and has limited support on Symbian. Specific information for Nokia Belle is available in Flash Lite on Nokia Browser for Symbian. Specific information for OLD Series 40 and Symbian devices is available in the Flash Lite Developers Library.

Article Metadata
Article
Created: cristovaodoj (12 Mar 2010)
Last edited: hamishwillee (13 May 2013)

Introduction on Symbols and MovieClips

Attaching symbols dynamically to frames is a quite simple and useful task in developing Flash Lite applications using ActionScript 2.0. In this post I'll teach you how to create a new symbol (MovieClip or Button) which can be exported to the wished frame by AS 2.0.


Procedure

  • Step 1: Create a rectangle or whatever drawing you wish.
  • Step 2: Convert it to a symbol (MovieClip or Button) as shown below:


Post01.PNG


  • Step 3: In the dialog box set the configurations as shown the the picture below, It's extreamly important check the "Export for ActionScript" option:
 Name: Instance type name of the symbol;
 Type: Symbol type, how it will behave.
 Identifier: Identifier that will be used to attach the newly created symbol to the frame using AS 2.0.

Click OK to finish the symbol creation.


Post2.PNG


  • Step 4: In the action of the frame which you want to attach the symbol type the following code:
var s1 = attachMovie("my_symbol", "symbol_01", 1);

That way you will have a button with name "symbol_01" in depth "1", as default it will be attached in the (0, 0) position; nevertheless you can put it whatever position you want, only see the code below:

var s1 = attachMovie("my_symbol", "symbol_01", 1);
s1._x = 50;
s1._y = 50;

Note.pngNote: You can attach as many button as you want, but you will have to set a different value in the third parameter (depth) of the "attachMovie" function for each of the symbol you want to.

  • More: To attach a MovieClip just do the same steps describled above, just set MovieClip to the Type field in the dialog box in the 'step 3'.

Tip.pngTip: MovieClips can be positioned only giving the following params to the "attachMovie" function:hMovie”:

var s1 = attachMovie("my_symbol", "symbol_01", 1, {_x: 50, _y: 50});
This page was last modified on 13 May 2013, at 23:43.
104 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×