Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I can't understand some slice of your code. </p> <ul> <li>Param of Message function isn't a variable and it's call like function name. </li> <li>You variable msg should be public</li> <li>Your function Message don't have a specific return value</li> <li>Message(Message); This has no sense!</li> </ul> <p>So, I don't know how your application work but I fix your code as follow:</p> <pre><code> public var msg:String = ""; function Message(msg:String):void { this.msg = msg;// Here you assign directly the message trace(this.msg); } </code></pre> <p>In the loader code if you want access to msg variable your code should work fine.</p> <p>Tip: You should use classes concat to your swfs and work with public method for access to these variables. If you have problems you could post more of your code to be more accurate.</p> <p>I hope this will be usefull to you!</p> <p><strong>UPDATE:</strong> I repeat, I don't know much about how your application is structured, I'd do as follow:</p> <ol> <li>Specific in Adobe Flash a document class for your fla project, for example <code>main.as</code></li> <li>Create another Adobe Flash project with a document class that extends MovieClip: For example <code>Message.as</code>. This class will export an swf call message.swf</li> <li>Put your loader function in Main.as.</li> <li><p>Your message class should written like this:</p> <pre><code>public class Message { private var _msg:String = ""; //Constructor public function Message(msg:String) { _msg = msg; } //Getter method public function get msg():String { return _msg; } } </code></pre></li> <li><p>In Main.as write loader function as you done and load message.swf (pay attention to file system position).</p></li> <li><p>When load is complete you can call getter method msg directly on loaded swf:</p> <pre><code>function onLoad(evt:Event):void { var loadedM:MovieClip = LoaderInfo(evt.target).content as MovieClip; trace(loadedM.msg); } </code></pre></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload