zechdc
zechdc

Reputation: 3404

How do I use AS3 to embed an SWF file and control is using .play()?

I have a folder "/assets/animations" filled with .swf files. I would like my AS3 script to embed all these assets so they can be later called to play or stop.

I hear a lot about the Loader class but it looks like it doesn't embed all the files at compile time but rather grab them from a url when needed.

Basically these assets are cut scenes for a flash game. I would like all of them to be present in one final .swf so its easy to play on any machine without an internet connection.

Upvotes: 1

Views: 9482

Answers (2)

xero
xero

Reputation: 4319

no, you cannot dynamically use the embed metadata command. it's actually more like an inline compiler argument than actual as3 code. so no, you can not use variables the embed command.

Upvotes: 1

PatrickS
PatrickS

Reputation: 9572

[Embed(source="scene1.swf", symbol="scene1ID")]
public var Scene1:Class;

private var scene1:MovieClip = new Scene1();
scene1.play(); 

This should help you... http://www.bit-101.com/blog/?p=853

Upvotes: 4

Related Questions