I need to load swf's that include many symbols which I need to
reference dynamically at runtime.

I am able to embed and link to symbols whose name I know at compile
time using:

[Embed(source='shapes.swf', symbol='greenSquare')]
[Bindable]
public var imgCls:Class;

I won't know some of my symbol names until runtime.

In the Help page "Embedding SWF files" there is an example of
referencing a symbol by using a string parameter:

The heart of it is:
----
         public var loadedSM:SystemManager;
            [Bindable]
            public var loadedLabel:Label;

            // Initialize variables with information from
            // the loaded application.
            private function initNestedAppProps():void {
                loadedSM = SystemManager(myLoader.content);
                loadedLabel = loadedSM.application["lblOne"];
            }
---
When I run the example I get a type conversion error at this line:
               loadedSM = SystemManager(myLoader.content);
(Droog3 is the project name.)
---
TypeError: Error #1034: Type Coercion failed: cannot convert
[EMAIL PROTECTED] to
mx.managers.SystemManager.
      at Droog3/::initNestedAppProps()
      at Droog3/__myLoader_creationComplete()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.core::UIComponent/set initialized()
      at mx.managers::LayoutManager/::doPhasedInstantiation()
      at mx.core::UIComponent/::callLaterDispatcher2()
      at mx.core::UIComponent/::callLaterDispatcher()
---

Did the example get broken by the move to beta 3? Did type
conversion rules for the SystemManager get more strict?

I'd love any help with this. Again, I need to get at a symbol using
a string parameter, as in the example:

loadedSM.application["lblOne"];

Thanks.







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to