Announcement

Collapse
No announcement yet.

SWF loading crash

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SWF loading crash

    Hello, I'm wondering what is the good way to load a SWF with AS3 ?

    I tried these instructions :
    PHP Code:
    var loader:Loader = new Loader();
    loader.load(new URLRequest("content.swf")); 
    But it causes a crash from UDK !

    #2
    I can confirm Loader works in Nov 2011 UDK using AS3:

    ActionScript 3 Code Snippet


    Code:
    // create a new Loader
    var loader:Loader = new Loader();
    
    // add the Loader to the root timeline
    this.addChild(loader);
    
    // load the SWF "content.swf" into the loader
    loader.load(new URLRequest("content.swf"));
    Also be sure to:
    1. Right click the original (loading) SWF in the content browser.
    2. Select Properties.
    3. Under GFx Raw Data, Open References.
    4. Click the green plus icon to add a new User Reference.
    5. Select the SWF movie you wish to load in the Content Browser so that it is highlighted.
    6. Press the green arrow in the new User Reference field to insert the SWF.
    7. Save the package.


    NOTE: Both SWFs should be in the same package in this case.


    I successfully loaded a simple SWF with a red square shape in it into a menu using the code and method above without crashing.

    Comment


      #3
      Thanks ! Is it possible to load a SWF wich is located in a different package ?

      Comment


        #4
        Yes. Just make sure the reference points to it.

        Comment


          #5
          Thank you very much, Matt ! It works fine.

          I didn't found about "GFx Raw Data" or the SWF loading in the documentation. You should add this

          Comment


            #6
            Originally posted by Meardon View Post
            Thanks ! Is it possible to load a SWF wich is located in a different package ?
            Originally posted by Matt Doyle View Post
            Yes. Just make sure the reference points to it.
            It no longer works after packaging the game :/

            Comment


              #7
              Is it possible to do this using ActionScript 2?

              Comment

              Working...
              X