Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Changing .swf Cooridinates

Community Beginner ,
Apr 16, 2009 Apr 16, 2009

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!

TOPICS
ActionScript
545
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 16, 2009 Apr 16, 2009

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."

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 16, 2009 Apr 16, 2009

Actually got it figured out!

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

Thanks though!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 16, 2009 Apr 16, 2009
LATEST

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."

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines