3 Replies Latest reply on Apr 16, 2009 9:39 AM by David Stiller

    Changing .swf Cooridinates

      Hey, I am trying to get a music player to play on my flash stage, and so far I have gotten it to work fine, but it's right in the middle of everything (text, links, etc.)

       

      Here is my code to load the .swf:

       

      this.createEmptyMovieClip("holder", 100);
      holder.loadMovie("playerMultipleList_old.swf");

       

       

      How can I get the coordinates to change so that it's, you know, further to the side..?

       

      Thanks!

        • 1. Re: Changing .swf Cooridinates
          David Stiller Level 2

          fastpicker89,

           

               The trick is to wait until the SWF has fully loaded.  At that point (and not before), you can reference the loaded SWF and treat it the same as any movie clip instance (that is, an instance of the MovieClip class) -- because SWFs actually are movie clips.    The MovieClip.loadMovie() method, which is what you're using, is fine ... you can definitely use it, but it's a slightly older method, one that takes a bit more effort to test against.  You might want to replace your loadMovie() approach with the MovieClipLoader class, which dispatches an event -- an event you can listen for and respond to -- when its content loads.

           

               Here's a brief article on all of the above:

           

               http://www.quip.net/blog/2006/flash/how-to-tell-when-external-swf-loaded

           

               So once your content is loaded, you reference it and set its MovieClip._x property to whatever value looks right.


               If you still have questions, don't hesitate to post again. 

           

           

           

          David Stiller
          Contributor, How to Cheat in Adobe Flash CS4
          http://tinyurl.com/dpsCheatFlashCS4
          "Luck is the residue of good design."

          • 2. Re: Changing .swf Cooridinates
            Level 1

            Actually got it figured out!

             

            this.createEmptyMovieClip("holder", 100);
            holder.loadMovie("playerMultipleList_old.swf");
            holder._x = 250 ;
            holder._y = 110;

             

            Thanks though!

            • 3. Re: Changing .swf Cooridinates
              David Stiller Level 2

              fastpicker89,

               

                   Ah, I see that.  Yup, that'll do it.  The extra steps I mentioned are necessary if you want to deal with event handling, such as turning the loaded content into a clickable button.  Positioning alone of your holder clip doesn't need what I mentioned.

               

               

              David Stiller
              Adobe Community Expert
              Dev blog, http://www.quip.net/blog/
              "Luck is the residue of good design."