View Full Version : Writing code in FlashDevelop and attaching instances from library
mixey
03-05-2008, 09:04 AM
Hi guys, I'm trying to migrate to AS 3.0 and I faced some difficulties.
Code is written in FlashDevelop and compiled with help of Flex SDK Everything is working great, but now I'm in need in connecting this code with the fla file more specifically I need to attach some instances from the fla file library.
So how can I make it?
This is a very newbie question but I really need your help,
Thank you in advance
Hugin_flight
03-05-2008, 10:06 AM
Firstly you have to define the instance in the library, by Right-Clicking on it in the Library > Linkage.
Click on the Export for ActionScript button and give it a class name, leave the rest as it is...
Is gonna tell you that it cant find a class by that name...just click ok...
Now in your AS fine you have to import that class name
Then create a variable and define it as being that particular class like so:
import Blue_btn;
blueButton:Blue_btn = new Blue_btn;
addChild(blueButton);
This should add that instance to the stage...
Then just use the new var to modify properties...
Hope it helps
mixey
03-05-2008, 10:10 AM
Thank you very much!
As simple as I expected but couldn't figure out by myself.
I'm a bit confused myself, as this is the straightforward method of using a library instance with code, but doesn't talk about how to use that library in compiling with the flash SDK in FlashDevelop..
I'm in a similar situation, but so far I just code in FD and then compile in Flash
monsieurfil
03-05-2008, 08:02 PM
The good solution is to:
- export you library symbols, kind of like in AS2 (CS3 will warn you that it will generates classes),
- check "Generate SWC" in your FLA publish setting,
- publish and add the generated SWC to your FD project ("Add to Library" with latest FD beta),
- now the library should be available in the completion and for publishing.
I must be missing something simple, "Add to Library" isn't an option on the SWC, although it is for images
Edit: Ah I still had beta5 on this computer.. oops </idiot>
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.