Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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."
Copy link to clipboard
Copied
Actually got it figured out!
this.createEmptyMovieClip("holder", 100);
holder.loadMovie("playerMultipleList_old.swf");
holder._x = 250 ;
holder._y = 110;
Thanks though!
Copy link to clipboard
Copied
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."
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more