Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / General Flash Topics / July 2008



Tip: Looking for answers? Try searching our database.

Blank Movie Clip

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
scharlton22 - 08 Jul 2008 14:23 GMT
Good day everyone, I am trying to create a blank movie clip and place it on a
layer on my root movie, however it won't work?
I think it is the original blankmovie. Can someone walk me through creating a
blank movie clip to load others into.

I have the button action to load to the clip as this:
blank_mc.loadMovie("Bob.swf");

Any elementary level help would be great!!

page_mc.loadMovie("PageSwfName.swf");
David Stiller - 08 Jul 2008 14:53 GMT
scharlton22,

> Can someone walk me through creating a blank movie clip
> to load others into.

   Select Insert > New Symbol.  In the dialog box that opens, set the Type
to Movie Clip, give it a Library name in the Name field, and click OK to
close the dialog box.  You'll see a new movie clip symbol in the Library by
whatever name you gave it.  Drag that movie clip to the Stage.  Because it's
empty, it will show up as a small white placeholder circle.

   Click the placeholder circle to select the symbol, and give it an
instance name (such as blank_mc) in the Property inspector.  At that point,
your earlier code:

> blank_mc.loadMovie("Bob.swf");

   Should work.  That invokes the MovieClip.loadMovie() method on the
blank_mc instance.

David Stiller
Co-author, Foundation Flash CS3 for Designers
http://tinyurl.com/2k29mj
"Luck is the residue of good design."
dzedward - 08 Jul 2008 15:01 GMT
http://forums.flashgods.org/as2-loading-external-swfs-t70.html
scharlton22 - 08 Jul 2008 15:39 GMT
that seems very complec compared to how I understood it to work?
How do I actually create a blank movieclip, or am I dumb? What you have provided me does that?
David Stiller - 08 Jul 2008 15:48 GMT
scharlton22,

> that seems very complec compared to how I understood it to work?

   What dz showed you is one of many ways to load content in AS2.
Personally, I use dz's approach more often than the more simplified
MovieClip.loadMovie() method, because the MovieClipLoader approach lets me
know when content has loaded.  That becomes very important if you want to
use ActionScript to manipulated loaded content once it arrives.

> How do I actually create a blank movieclip, or am I dumb? What you
> have provided me does that?

   dz's suggestion creates a blank movie clip with ActionScript
(this.createEmptyMovieClip()), but you can just as well create a movie clip
in the Library by hand.  Again, for what it's worth, I usually create blank
movie clips with ActionScript, but the choice is yours.

   It really depends on whether or not you want to know when your content
is loaded.  If you use loadMovie(), you won't know -- unless you write
additional ActionScript that lets you know.  If knowing is important to your
project, I recommend MovieClipLoader, same as dz does.  If you prefer an
older approach, you can read about it (and the other) here:

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

David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."
dzedward - 08 Jul 2008 16:53 GMT
rather than using loadMovie, I'm suggesting that you use the MovieClipLoader
class.  The link I provided is the complete code that creates a blank movie
clip and loads the swf into it.  It allows you to do something while the swf is
loading, and something once it has finished.  So where you have your code,
replace it with the script that can be found at the link, and change
mcLoader.loadClip("swfName.swf", container); to
mcLoader.loadClip("PageSwfName.swf", container);
Cor - 09 Jul 2008 08:47 GMT
I am looking for an example how to do this in AS30 with classes.
Can you show me or direct me to one?

TIA

Kind regards
Cor
akittymom - 08 Jul 2008 18:35 GMT
The code that is referred to says it is in AS2. What would the code be for AC3?
David Stiller - 08 Jul 2008 19:30 GMT
akittymom,

> The code that is referred to says it is in AS2. What would the code be for
> AC3?

   Different beast altogether.  You don't even need a movieclip for that.

var loader:Loader = new Loader();
loader.load(new URLRequest("somefile.swf"));
addChild(loader);

   That's minimal code, comparable to the MovieClip.loadMovie() example
shown earlier in the thread.  If you want to listen for a complete even --  
meaning, if you want to know when the SWF has loaded -- you'll have to add
an event listener:

var loader:Loader = new Loader();
loader.load(new URLRequest("somefile.swf"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
addChild(loader);

function completeHandler(evt:Event):void {
 trace("Your content, she is loaded!");
}

David Stiller
Co-author, Foundation Flash CS3 for Designers
http://tinyurl.com/2k29mj
"Luck is the residue of good design."
scharlton22 - 12 Jul 2008 20:10 GMT
thanks everyone, i love this forum!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.