Symbols don't exist in AS3, there are only classes.
If you exported the SWF from Flash as an AS3 SWF, you should be able to
use getDefinitionByName to find the class instance in the dynamically
loaded SWF.
The compiler knows how to reference old-style Flash symbols at compile
time (via Embed). However, this is only for older SWFs. You can't
reference an AS3 class this way.
-rg
________________________________
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Rick Schmitty
Sent: Friday, December 29, 2006 11:50 AM
To: [email protected]
Subject: [flexcoders] How do you load library symbols without
embedding via SWFLoader?
Hi all, trying to load some assets from a Flash AS3Preview
project but
I can't figure out how to specify the symbol when loading
dynamically
Here's the flex example
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> ">
<mx:Script>
<![CDATA[
[Bindable]
[Embed(source="/ball.swf", symbol="ball_mc")]
public var swf:Class;
public function debug():void {
trace("set break point here and inspect swfLoader.content vs
swfLoaderEmbed");
swfLoaderEmbed.content["label_txt"].text="Hello World!";
}
]]>
</mx:Script>
<mx:SWFLoader id="swfLoader" source="ball.swf"/>
<mx:SWFLoader id="swfLoaderEmbed" source="{swf}"/>
<mx:Button label="click" click="debug()"/>
</mx:Application>
Ball.swf is a simple ball contained in ball_mc in the library,
and it
has a text field in that object of the name label_txt
How do I work in the symbol=xxx aspect of the embed into the
SWFLoader
that is loading dynamically? This library could potentially be
very
large and I'd rather not embed the whole thing up front