Loading mc into empty mc with button

I did this many years ago and I tried searching for this but did not find what I was looking for. I basically have a group of buttons and I want the buttons to load movie clips into an empty mc and then have the movie clip close again when the user clicks somewhere else. Do I actually have to save the movie clips as swf files first and then load them in to the empty mc?
Thanks!

You can save them as swfs if you like, or you can have them as movieclips in your library and add them from there.  To add them from the library you need to assign a class name for each one and then you can create a new instance using the class name.  To assign a class name, right click the mc in the library and select Linkage.  In the panel that appears select the option to export for actionscript and then assign a clas name for the object in the field labeled as such.
Then to add it to your empty movieclip you would use... (assume you gave it a class name of "NewMC", and your empty movieclip is named "emptyMC")...
var newmc:NewMC = new NewMC();
emptyMC.addChild(newmc);
"newmc" is just an arbirtrary name assigned to the instance being created

Similar Messages

  • Loading swf into empty mc in a html page

    Hello Flashers,
    I've set up a html page that contains a swf file with an
    empty movie clip in which I wish to load another swf.
    However I trie to do it, it just won't listen.
    Can anybody help me with this.
    Situation:
    html page (complete one, with tables etc.) contains main swf
    file (in a table) which contains an empty movie clip.
    Within the main swf there is a button which should load
    another swf file into the empty movie clip.
    What happens is that the external movie clip is loaded into
    level 0 of the main movie.
    It usualy works fine just with flash site but within the html
    page it results differently.
    Is it possible to get it right.
    Thanks
    Justin Time

    Urami, thanks for your interest for helping me ( and others,
    as far as I know )
    I'll try to explain it in more details ( although english is
    not my language)
    I've made a html page which contains a swf file ( theMAIN )
    in one table, other tables are filled with gif's, jpeg's etc.
    In the main movie - theMAIN - there is a empty movie clip
    with instance name "deder_mc" which is ment to accept loaded swf's.
    There is also a button with action ---- on release :
    _global.theMAIN.loadMovie("./swf_s/000_studioG.swf", "deder_mc");
    That means, when user click this button movie
    000_studioG.swf should be loaded into deder_mc empty movie
    clip.
    The movie 000_studioG.swf is located in swf_s folder in site
    root.
    _global.theMAIN = this;
    is a action script in a first frame of the main movie so it
    build a reference to it.
    I've done it before but site was built complete in Flash and
    I did not had any problems with loading external movies into empty
    movie clips. Not long before I've red somewhere(don't remember
    where) that this don't work in swf in a html page.
    But I live in a hope that I would be able to build a html
    site which contains swf which can load external movies into empty
    movie clips. So I am looking for solution.
    I hope it's enough information for you to tell me a solution
    if you know the right answer.
    Thank you.

  • Load swf into movieclip // play pause buttons

    I am going out of my mind trying to get this to work. I can do it in AS2 without a hitch - but not AS3.
    I just need to load an external swf file into an empty movieclip. Then I have 2 buttons play and pause that need to be on the top layer of the new movie and they need to play and pause the loaded swf file.
    I have tried a number of things and nothing is working. Please help.
    Thank you in advance.
    Shawna

    you can use:
    var ldr:Loader=new Loader();
    addChild(ldr);
    ldr.load(new URLRequest("yourswfthatyouwanttoload.swf"));
    addChild(yourplaybtn);
    addChild(yourpausebtn);
    yourplaybtn.addEventListener(MouseEvent.CLICK,playF);
    yourpausebtn.addEventListener(MouseEvent.CLICK.pauseF);
    function playF(e:Event){
    MovieClip(ldr.content).play();
    function pauseF(e:Event){
    MovieClip(ldr.content).stop();

  • Load SWF into empty movieClip?

    Hello,
    Could anyone please point me in the right direction to find
    out how to load an external SWF into an already existing movieClip
    instance that is already placed on the stage? This is the way I've
    always worked in AS2, but I can't find how to do it in AS3. Can
    anyone point me to an example where URLRequest works with a
    specified movieClip instance?
    Thank you!

    I understand why you might think I was ignoring your advice,
    but this isn't the case. You're expertise is much valued and
    respected.
    My purpose for continuing to experiment with loading into a
    movieClip was an attempt to find an easy way to layer the SWF
    behind other elements, but as you know, although it works for this
    purpose, it doesn't allow control of the loaded SWF from the main
    timeline. For others struggling to learn as I am, here's a link
    where I found the answer to my question above:
    http://www.hostingforum.ca/776586-as3-controlling-loaded-swf.html
    The transition to AS3 is not as easy for some as for others,
    and there are new concepts to understand.
    Don't know what "nvm" means... curious, but might be better
    off not knowing ;) Thanks again for all the help you offer to all
    of us who are struggling.

  • Load .flv into empty symbol?

    hi
    is it possible to load an .flv file into a symbol? i know it
    is possible with a .swf file. but it does not seem to work with an
    flv. am i doing somethiing wrong or is it not supposed to work?
    basically i am trying to make different movies load into a
    single movie player (symbol) i can get it to work loading swfs i
    made of the individual videos sitting inside their own fla files
    but i am just wondering if it is possible to just load the flv
    files without the extra complication of the extra fla per video.
    i also know that the way i am doing it is the long way round
    but i know absolutely nothing of action script and am doing it the
    way i was taught in the total training videos that i bought.
    cheers !
    angus

    you should be streaming your flv files. that's what they were
    designed to work.
    you can use the flvplayback component to do all the coding
    for you. all you have to do is assign the flv's location/name and
    the component will do the rest.

  • Loading data into Fact/Cube with surrogate keys from SCD2

    We have created 2 dimensions, CUSTOMER & PRODUCT with surrogate keys to reflect SCD Type 2.
    We now have the transactional data that we need to load.
    The data has a customer id that relates to the natural key of the customer dimension and a product id that relates to the natural key of the product dimension.
    Can anyone point us in the direction of some documentation that explains the steps necessary to populate our fact table with the appropriate surrgoate key?
    We assume that we need to have an lookup table between the current version of the customer and the incoming transaction data - but not sure how to go about this.
    Thanks in advance for your help.
    Laura

    Hi Laura
    There is another way to handling SCD and changing Facts. This is to use a different table for the history. Let me explain.
    The standard approach has these three steps:
    1. Determine if a change has occurred
    2. End Date the existing record
    3. Insert a new record into the same table with a new Start Date and dummy End Date, using a new surrogate key
    The modified approach also has three steps:
    1. Determine if a change has occurred
    2. Copy the existing record to a history table, setting the appropriate End Date en route
    3. Update the existing record with the changed information giving the record a new Start Date, but retaining the original surrogate key
    What else do you need to do?
    The current table can use the surrogate key as the primary key with the natural key being being a unique key. The history table has the surrogate key and the end date in the primary key, with a unique key on the natural key and the end date. For end user queries which in more than 90% of the time go against current data this method is much faster because only current records are in the main table and no filters are needed on dates. If a user wants to query history and current combined then a view which uses a union of the main and historical data can be used. One more thing to note is that if you adopt this approach for your dimension tables then they always keep the same surrogate key for the index. This means that if you follow a strict Kimball approach to make the primary key of the fact table be a composite key made up of the foreign keys from each dimension, you NEVER have to rework this primary key. It always points to the correct dimension, thereby eliminating the need for a surrogate key on the fact table!
    I am using this technique to great effect in my current contract and performance is excellent. The splitter at the end of the map splits the data into three sets. Set one is for an insert into the main table when there is no match on the natural key. Set two is when there is a match on the natural key and the delta comparison has determined that a change occurred. In this case the current row needs to be copied into history, setting the End Date to the system date en route. Set three is also when there is a match on the natural key and the delta comparison has determined that a change occurred. In this case the main record is simply updated with the Start Date being reset to the system date.
    By the way, I intend to put a white paper together on this approach if anyone is interested.
    Hope this helps
    Regards
    Michael

  • Loading movie clip to stage with button click AS3

    I'm trying to figure out how to load a movie clip to the stage with a button click and have the movieclip close again using a close button. Does anyone have a step by step on how to do this or links to some tutorials.
    Below is an example of what I'm trying to do.

    Alrighty I changed the publish settings to as3. I'm still getting two errors:
    Scene 1
    1046: Type was not found or was not a compile-time constant: Popup1Btn.
    Scene 1, Layer 'as', Frame 1, Line 3
    1061: Call to a possibly undefined method addEventListener through a reference with static type Class.
    So my setup on my main timeline is I have an actionscript layer with this code now:
    var popup1:Popup1
    Popup1Btn.addEventListener(MouseEvent.CLICK,addF);
    ClosePopup1.addEventListener(MouseEvent.CLICK,closeF);
    function addF(e:MouseEvent):void{
    popup1=new Popup1();
    addChild(popup1);
    function closeF(e:MouseEvent):void{
    removeChild(popup1);
    popup1=null;
    On the stage I have a button with the isntance/AS linkage name Popup1Btn. Inside my Popup1 MC I have a box with text and then a button with the instance/linkage name ClosePopup1 to close the popup.
    What am I missing?

  • Unable to paste clips from source monitor into the timeline with buttons

    hi,
    working with the newest version of premiere pro cc 2014.
    I'am unable to paste clips from the source monitor into the timeline by neither using the buttons below the source monitor nor hitting the shortcut "," .
    dragging the clip in the timeline still works... is there a hidden setting to enable this functions again or is it a bug?
    thanks in advance
    yannick

    Thanks a lot!
    Further Information: Adobe Premiere Pro Help | Source patching and track targeting

  • Enable Dropping into Empty JTables

    Hi there!
    I've just posted another blog on Swing Drag and Drop. Learn how to enable dropping into empty JTables with a single method call in Mustang, or a simple override in earlier versions of J2SE.
    http://weblogs.java.net/blog/shan_man/archive/2006/01/enable_dropping.html
    All the best,
    Shannon Hickey (Swing Team)

    Hi,
    It looks like below bug in SQLDeveloper.
    Bug 6326721: Updatable views - could not insert, update and delete as for tables.
    Please close the thread, if I answered your question.
    Regards,
    Satishbabu Gunukula
    http://oracleracexpert.blogspot.com

  • Missing/empty symbols, "Could not load scene into memory. Your document may be damaged." CS6

    Hey folks,
    we've been getting this problem a lot. We had it in Flash CS5.5 and still have it CS6.
    We're animating a series in Flash and this problem keeps cropping up way to often, but seems totally random.
    Basically I'll be working on a .fla saving regular versions through out the day, no problems. I'll close the file down. Then I (or someone else on a different computer) will open it up and I'll get the error msg "Could not load scene into memory. Your document may be damaged." Everything will be fine except for a few missing graphic symbols. Sometimes just the one, sometimes a whole bunch. So where the symbol should be on the stage, instead you get a small white square, but it still contains the animation information. So it will still move about the stage. If I bring in the same symbol from an old scene I can swap them out and the problem is fixed, (until it does it again on a totally different graphic symbol).
    If i select the symbol in the library the preview is white/blank and i can't go into it to edit. When I select the symbol on the stage, the "instance of:" gives me a blank "_ _ _" in the properties tab. How ever if i right click show in library it does show me the correct (although broken as in blank) symbol in the library.
    I havent been able to reproduce this problem on purpose but I'd say it happens in roughly one scene out of 10. Its seems to happen at random, I know there must be something in common but i havent figured out what. Its going on in heavy scenes (large library multipule characters), lite scenes (just the one character). Its not like it happens to the same symbol, different ones each time. Everything is local to the scene, all elements are created in flash. We are working across a network but as everything is local to the scene i don't see how that would be a problem. Also we don't have duplicate named symbols. It also won't necessarily affect something that has been changed since the last version. could be a background element thats been there, untouched since the first version of the scene.
    One point on how we set up our scenes which may be relevant. Start with empty scene, copy and paste symbols from other scenes to populate. Save.
    The problem could appear on say version 4 or version 36. Older versions are usually fine.
    So to sum up. Flash file is fine when we save it, open it up again later and a symbol will have disappeared. It's happening far too often.
    I know how to fix the problem, thats not what I'm asking. I need to know WHY its doing it so we can stop this from happening in the first place.
    Phew! Thanks for reading this far. Any help would be highly appreciated.
    Sander/

    Can you elaborate on how you use the network? Are you working from FLA/XFLs stored on a machine across a network (and saving them across the network)? I had plenty of those issues and Adobe has always warned not to work across a network. I just fell into the habit of copying over what I need to work on locally, then updating the file servers at the end of the day. Nothing was corrupt after that.
    Also lately in CS5.5 (not CS6 yet) I had noticed that I could change some graphics assets, close the document in OS X and open in Windows only to find freshly updated graphics reverted back. What's even more odd is if the OS X machine that made the changes opens it the changes are still made. This happens vice versa as well. My only solution on that was not to work cross-platform with other machines on a network unless absolutely necessary.

  • Loaded swf with button , not communicating to main timeline

    my main stage/timeline has a UILoader "UILoaderOne" and
    another one "UIloaderTwo".
    i have some buttons on the main stage which pull up some
    images into the UILoaderOne.
    these work fine and look like this.
    //BEGIN BUTTONCODE\\
    //button to load image into loader "loaderOne" x01_btn and
    x01_ldr, thumb image is "x01.jpg and main image is p01.jpg\\
    //crop thumb image to size 50px tall by whatever wide and
    resize loaderButton if needed, main image will resize
    proportionatly\\
    x01_btn.addEventListener(MouseEvent.CLICK, onClick);
    function onClick(event:MouseEvent):void
    //import fl.containers.UILoader;
    import fl.controls.Label;
    import fl.controls.ProgressBar;
    var url:String = "assets/01.jpg";
    //var myUILoader:UILoader //= new UILoader();
    myUILoader.unload();
    myUILoader.autoLoad = false;
    myUILoader.source = url;
    //myUILoader.move(10, 10);
    myUILoader.scaleContent = true;
    myUILoader.load();
    var myProgressBar:ProgressBar = new ProgressBar();
    myProgressBar.source = myUILoader;
    myProgressBar.setSize(100, 10);
    myProgressBar.move(myUILoader.x+340, myUILoader.y+250)
    myProgressBar.addEventListener(ProgressEvent.PROGRESS,
    progressHandler);
    myProgressBar.addEventListener(Event.COMPLETE,
    completeHandler);
    addChild(myProgressBar)
    var myLabel:Label = new Label();
    myLabel.text = ". . . . . X . . . . . ";
    myLabel.autoSize = TextFieldAutoSize.LEFT;
    myLabel.move(myProgressBar.x, myProgressBar.y +
    myProgressBar.height);
    addChild(myLabel);
    function progressHandler(event:ProgressEvent):void {
    //trace("progress:", event.bytesLoaded, event.bytesTotal,
    int(event.currentTarget.percentComplete) + "%");
    //myLabel.text = event.bytesLoaded + " of " +
    event.bytesTotal + " bytes loaded.";
    myLabel.text = ("progress:", event.bytesLoaded,
    event.bytesTotal, int(event.currentTarget.percentComplete) + "%")
    //myLabel.text =
    Math.round((event.bytesLoaded/event.bytesTotal)*100) +"%";
    function completeHandler(event:Event):void {
    trace("complete:");
    myProgressBar.removeEventListener(ProgressEvent.PROGRESS,
    progressHandler);
    myProgressBar.removeEventListener(Event.COMPLETE,
    completeHandler);
    removeChild(myProgressBar);
    removeChild(myLabel);
    //addChild(myUILoader);
    //trace("typeMe");
    //end BUTTONCODE\\
    //end BUTTONCODE\\
    the second Loader "UILoaderTwo" auto loads another swf file
    with the INTENT to load from buttons, images into the ULLoader
    "UILoaderOne" which is on the main timeline.
    this part is failing
    the error i get in Output window is
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at sOne_fla::MainTimeline/onClickz()
    the swf that loads is sOne.swf
    and it has code of this
    z01_btn.addEventListener(MouseEvent.CLICK, onClickz);
    function onClickz(event:MouseEvent):void
    import fl.containers.UILoader;
    import fl.controls.Label;
    import fl.controls.ProgressBar;
    var url:String = "assets/xx.jpg";
    var myUILoader:UILoader //= new UILoader();
    myUILoader.unload();
    myUILoader.autoLoad = false;
    myUILoader.source = url;
    //myUILoader.move(10, 10);
    myUILoader.scaleContent = true;
    myUILoader.load();
    var myProgressBar:ProgressBar = new ProgressBar();
    myProgressBar.source = myUILoader;
    myProgressBar.setSize(100, 10);
    myProgressBar.move(myUILoader.x+340, myUILoader.y+250)
    myProgressBar.addEventListener(ProgressEvent.PROGRESS,
    progressHandler);
    myProgressBar.addEventListener(Event.COMPLETE,
    completeHandler);
    addChild(myProgressBar)
    var myLabel:Label = new Label();
    myLabel.text = ". . . . . X . . . . . ";
    myLabel.autoSize = TextFieldAutoSize.LEFT;
    myLabel.move(myProgressBar.x, myProgressBar.y +
    myProgressBar.height);
    addChild(myLabel);
    function progressHandler(event:ProgressEvent):void {
    //trace("progress:", event.bytesLoaded, event.bytesTotal,
    int(event.currentTarget.percentComplete) + "%");
    //myLabel.text = event.bytesLoaded + " of " +
    event.bytesTotal + " bytes loaded.";
    myLabel.text = ("progress:", event.bytesLoaded,
    event.bytesTotal, int(event.currentTarget.percentComplete) + "%")
    //myLabel.text =
    Math.round((event.bytesLoaded/event.bytesTotal)*100) +"%";
    function completeHandler(event:Event):void {
    trace("complete:");
    myProgressBar.removeEventListener(ProgressEvent.PROGRESS,
    progressHandler);
    myProgressBar.removeEventListener(Event.COMPLETE,
    completeHandler);
    removeChild(myProgressBar);
    removeChild(myLabel);
    //addChild(myUILoader);
    //trace("typeMe");
    //end BUTTONCODE\\
    //end BUTTONCODE\\

    well, I'm such a novice to begin with.
    the loader is actually placed on stage manually, and instance
    named manually so a lot of that code is may not be needed,
    i do a lot of trial and error technique
    it is all personal stuff
    one guess i have is to set up a listner as to when the sOne
    is loaded, and then get a way to communicate to each other?
    how?

  • How can I load data into table with SQL*LOADER

    how can I load data into table with SQL*LOADER
    when column data length more than 255 bytes?
    when column exceed 255 ,data can not be insert into table by SQL*LOADER
    CREATE TABLE A (
    A VARCHAR2 ( 10 ) ,
    B VARCHAR2 ( 10 ) ,
    C VARCHAR2 ( 10 ) ,
    E VARCHAR2 ( 2000 ) );
    control file:
    load data
    append into table A
    fields terminated by X'09'
    (A , B , C , E )
    SQL*LOADER command:
    sqlldr test/test control=A_ctl.txt data=A.xls log=b.log
    datafile:
    column E is more than 255bytes
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)

    Check this out.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1006961

  • HT201263 i need to get my iphone into recovery mode with a broken home button and is disabled, my exgirlfriend has the laptop i synced it with, what should i do??

    i need to get my iphone into recovery mode with a broken home button and is disabled, my exgirlfriend has the laptop i synced it with, what should i do??

    i have the same probelm did u get it solved if yess how ?

  • While in email today, the computer began flashing. I had to turn off with button. When I turned it back on, I got the apple icon and the moving loading wheel. It would turn for about 60 seconds and then stop. I turned off again. I now have a black screen.

    while in email today, the computer began flashing. I had to turn off with button. When I turned it back on, I got the apple icon and the moving loading wheel. It would turn for about 60 seconds and then stop. I turned off again. I now have a black screen.

    Hi wiesenruth,
    If you are having issues starting up or booting your computer, you may find the following articles helpful:
    Troubleshooting: My computer won't turn on
    http://support.apple.com/kb/TS1367
    Mac OS X: Gray screen appears during startup
    http://support.apple.com/kb/ts2570
    Regards,
    - Brenden

  • Latest version of OSX that can be loaded into a MBAir with 1.6Ghz Intel Core 2 Duo.

    what is the latest version of OSX that can be loaded into a MBAir with 1.6Ghz Intel Core 2 Duo. Currently have 10.7.5

    To use Mountain Lion or Mavericks you must have at least a MacBook Air2,1 which you can check by clicking the apple left side of the menu bar, About This Mac, More Info, System Report, Hardware and what does it show for the Model Identifier?

Maybe you are looking for

  • ESS SP11  upgrade error in travel request

    Dear All, We have recenlty up graded to ESS-SP11 package, The intial travel request is coming. But When I click on "dditional destination" or "Review" button , The following dump is coming. The same is happening in travel expense as well. The error i

  • Suspected imac overheating- help!

    Im wondering if my imac is overheating. My sims 3 game keeps shutting down and when i leave it for half hour it will play again for a couple of hours then shuts down. Its summer here so temps up to 100 deg (35 celcius). The imac affter sims shuts is

  • Migrating queries from 3.5 to 7.0

    hi, we are in the process of migrating from BW 3.5 to BI 7.0. i would like to know, what are the steps to be executed to migrate queries from 3.5 to 7.0.

  • Remove decimales in an formula in MS Project 2010

    Hi, we have created an formula for cost (actual cost /cost * 100) so we can get an % off the cost used in the project. After som testing and trying we found on formula to use : (CStr([Actual Cost] / [Cost]) * 100) & "%" But the % number that appers i

  • FCP not responding, help!

    Hi there, I have some serious trouble. I am running FCP 5.1 and I cannot open my program. I have recently had low disc space, but have now freed up space on my start up disc, but still the program will not open. It starts to load but does not get any