Playing a Movie Clip within a Movie Clip on load

Hi,
I'm trying to play a Movie Clip animation that is within a Movie Clip after a button has been pressed in a different Movie Clip.
The issue is that all Movie Clip animations are playing as soon as the SWF is loaded.
I have a separate Main.as file that contains all of the coding except for the animation stops:
package
          import flash.display.MovieClip;
          import flash.events.MouseEvent;
          public class Main extends MovieClip
          var title1:Title1;
          var scene1:Scene1;
          var scene2:Scene2;
          var scene3:Scene3;
          var scene4:Scene4;
          var scene5:Scene5;
          var scene6:Scene6;
          var scene7:Scene7;
          var scene8:Scene8;
          var scene9:Scene9;
          var scene10:Scene10;
          public function Main()
                    title1 = new Title1();
                    scene1 = new Scene1();
                    scene2 = new Scene2();
                    scene3 = new Scene3();
                    scene4 = new Scene4();
                    scene5 = new Scene5();
                    scene6 = new Scene6();
                    scene7 = new Scene7();
                    scene8 = new Scene8();
                    scene9 = new Scene9();
                    scene10 = new Scene10();
                    addChild(title1);
                    title1.buttonStart.addEventListener(MouseEvent.CLICK,onButtonStartClick);
                    scene1.buttonWalkOutside.addEventListener(MouseEvent.CLICK,onButtonWalkOutsideC lick);
          //title
          function onButtonStartClick(event:MouseEvent):void
                    addChild(scene1);
                    removeChild(title1);
                    Scene1(parent).gotoAndPlay("frame1")
          //scene1
          function onButtonWalkOutsideClick(event:MouseEvent):void
                    addChild(scene2);
                    removeChild(scene1);
So right now, I'm getting this error:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@46534041 to Scene1.
          at Main/onButtonStartClick()
Any help is greatly appreciated... I've been grinding at this all night.

I had been trying a bunch of different methods after searching for clues on Google, so it probably doesn't make sense with the parent.
I replaced the code with what you wrote, and I am given this error now:
Main.as, Line 44
1120: Access of undefined property scene1Text1.
Is there somewhere I have to declare scene1Text1 in Main.as?

Similar Messages

  • Can one cut and paste an audio clip within a movie to use in another place?

    can one copy and paste an audio clip within a movie to use in another place?  Any help would be appreciated.  Thanks

    If you are wanting to use the audio from clip A into clip B then try......
    First check that Advanced tools are enabled: iMovie>Preferences>General>Show Advanced Tools.
    Drag clip A from the Event UPON clip B in the Project. When you release the mouse you will get a pop up menue.
    Select Audio Only. Note the other options for another day!!!!
    You will get a green bar as Karsten mentions above ( move it , shorten it etc, etc.)
    Show Audio Waveform by selecting Blue Waveform Box ,bottom right of Project Window.
    You can adjust audio level from clip A and clip B to your requirements.You can set either to zero volume if you require.
    This may not be what you meant by "to use in another place "
    If you want just the audio to use outside of iMovie, try;
    With the required clip/clips only in the project> Share> Export Using Quicktime and in Export Select "Sound To AIFF. Save to desktop in the first instance so you can easily find it.

  • TellTarget to play a movie clip within a movie clip

    I currently have two movie clips in my scene with a button
    that lies inside one of the movie clips. We will call this movie
    clip for the sake of this post "ph." The button inside of ph has a
    rollOver/rollOut movie clip called "Buick_rollOut" attached to it
    as a parked movie clip through tellTarget. Currently Buick_rollOut
    only works if I put the parked movie clip on the same level as ph.
    I want Buick_rollOut to be within the movie clip, ph, that contains
    the button. I want that button be able to tellTarget the location
    of Buick_rollOut within ph. I hope this makes sense. Here is my
    code for the button that lies within ph. (this code only works when
    Buick_rollOut is located outside of ph on the same level).

    Is this code running on the button? What's the name of the
    button?
    Things would be a little clearer if you replaced tellTarget
    with dot notation:
    Buick_rollOut.gotoAndPlay("rollOver");

  • How to unload a movie clip within a movie clip.

    Hi all,
    I am trying to unload a movie clip that is on a layer in a
    movie clip. After clicking on a button, I would like the movie to
    go back to the previous menu without playing a couple of movie
    clips that's in the main movie clip.
    So at the end of my movie clip I have:
    _parent.gotoAndPlay("resources"); // resources is the frame
    name in the main movie clip where I would like the movie to restart
    from
    _parent.vhost_mc.unloadMovie("vhost_mc"); //vhost_mc is a
    movie clip in the main movie clip that I want to unload
    _parent.videoScreen_mc.unloadMovie();
    But the videoScreen_mc doesn't unload. The main movie clip
    starts with the videoScreen and I've actually deleted the frames of
    videoScreen_mc where the "resources" frame starts, but still it
    appears.
    I've even tried _parent.videoScreen_mc._visible = false; but
    nothing works! I've tried createEmptyMovieClip, but since the
    videoScreen_mc is on the main timeline, I don't think it works.
    I've even tried putting this function on the "resources" frame:
    onEnterFrame = function() {
    play();
    vhost_mc.unloadMovie("vhost_mc");
    vhost_mc.removeMovieClip();
    this.videoScreen_mc.unloadMovie();
    this.videoScreen_mc.removeMovieClip();
    this.mask._visible = false;
    But when I do this, the play button loops starting at the
    "resources" frame.
    Essentially I would like the main movie clip to play without
    certain movie clips that's included within the main movie clip.
    I hope I'm making sense. Please help, I've been at this for
    days!

    Olá Felipe, tudo bem com você?
    In order to unload content loaded into a Loader object you can use either the unload() method or the unloadAndStop() method. The difference between them is that unloadAndStop() will unload the loaded SWF and try to stop executing any code that it was running including animations, sound and event listeners.
    If you wanto to call the unload() or unloadAndStop() methods from the loaded SWF you can use its loaderInfo.loader property to reference the Loader object that loaded it.
    It could be someting like this:
    this.closeButton.addEventListener(MouseEvent.CLICK, this.handleClose);
    protected function handleClose(event:MoueEvent):void {
         this.loaderInfo.loader.unloadAndStop();
    You can pass a Boolean parameter to unloadAndStop() to indicate if Flash's garbage collector should be run ont the unloaded SWF in order to free up memory. Considering the size of your SWFs, this could be a good option. The downside is that there is a performance penalty and in my professional experience, CPU is still a resource that is more scarce than memory, so use with care.
    Hope this helps.
    Abraço,
    Rui

  • All my video clips within my movie have a yellow warning symbol in the lower left-hand corner. Can't seem to understand why. Help?

    All my video clips in an almost-complete movie now have a yellow warning symbol in the lower-left hand corner. How can I resolve this?

    It's hard to say - as You can select to use another one in another location - which I know nothing about.
    • to find out where iMovie tries to find material - As I remember it one put the pointer arrow ontop of one yellow exclemation mark and "Hands off" for some secondes - and it will tell.
    I use to do a quick - [Shift+cmd+3] to do a screen dump - so that I can read this address in full and try to set all material back to this location. iMovie can not be set to find it elsewhere - only alt is to re-insert material and now not move it - but this is most often a more tedious way - than just move material back to where iMovie tries to find it.
    • To set iPhoto to another Library
    - Start iPhoto - BUT KEEP - alt-key down during full up-start (also called the option key)
    - Now You can select another one
    Yours Bengt W

  • Problems coding a button within a movie clip to navigate scenes

    Hello there! I've got another probably noobish question to ask about CS6.
    My goal is very similar to the one mentioned in this previously discussed forum question: http://forums.adobe.com/message/837995#837995 and also in this question http://forums.adobe.com/message/4172919#4172919
    I am attempting to make a button inside a movie clip in my first scene go when clicked to the first frame of my second scene. I named the button's instance menu_button_1 and I believe Scene 1 and Scene 2 are the names of the scenes. (If they should have special names or instance names, I did not see where to type them.) Because of the similarities, I attempted to follow the suggestions on those pages. However I probably did some small thing wrong, (Or heck, maybe a huge thing.) which I what I'd like help with to find.
    stop();
    myButton.addEventListener(MouseEvent.CLICK, clickHandler);
    function clickHandler(evt:MouseEvent):void {
    gotoAndStop(1, "Scene 1");
    This seemed to be what was suggested to enter. I attempted to modify it to work for me as well. This is what I typed for the button's action.
    menu_button_1.addEventListener(MouseEvent.CLICK, clickHandler);
    function clickHandler(evt:MouseEvent):void {
    gotoAndPlay(1, "Scene 2");
    (I removed the stop function because I have music looping in the movie clip that I want to play until the mouse is clicked.) (Also, I picked gotoandplay because I wanted scene 2 to start playing immediately when clicked rather than stopping.)
    I tried variations, including "2" instead of "scene 2" and whatnot. I also tried linking it to differnet places just to see if that would work. It seems like it could link if I only asked for a frame within the movie clip itself, but it couldn't go to any other frames in scene 1 or scene 2. When I attempt, this message is displayed in the output:
    ArgumentError: Error #2108: Scene 2 was not found.
        at flash.display::MovieClip/gotoAndPlay()
        at interactivestgermant_fla::menu_1/clickHandler()
    It seems it cannot find my Scene 2. (It also cannot seem to find Scene 1 when I prompt it to do that.) I'm afraid I'm not sure of what I've entered incorrectly, though I'd imagine it involves how I typed the scene navigation. Should it have an instance name or something? I'd very muchappreciate a push in the right direction. If you need any more info I'll be happy to provide it. Thanks for the help! I very much appreciate it.

    I bet you're absolutely right. However I am not sure how I am misnaming it, as to my ametuer eyes, it seems to be entered properly into the properties box? It does show up as "menu" written in white over the keyframes and also in the properties slot. I can include some images here to help out in correcting me.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-1-395704638   This image shows my movie clip. This seems to be the problem it's having, identifying "menu." Did I do that incorrectly? It looks to be in order.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-2-395704633 This is inside of the movie clip named menu. You can see I did the same to name the button menu_button_1.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-3-395704627   This shows the action I gave to menu_button_1 in which I attempt to have it naviagte to Scene 1 frame 493.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-4-395704623  This shows where I'd like the button to go to. (It is hard to tell if that's frame 493 or 492. I figured that it should be ok either way and if this frame is 492 then it's easily changed once I get the darn thing working in general) (Also, I named the layer "peanuts." I tired entering the name "peanuts" as well but it didn't seem to work either, so I figured "493" is easier since I know that you can go to a specific frame by doing gotoandplay("scene 1" , #) and I'm not sure if it requires any additional stuff to go to a name.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-5-395704687    These are the errors I get. I totally agree with you- It seems very much to be an issue of getting it to recognize the "menu." However I am unsure where I named something wrong. Is this enough info to help you perhaps point out where that is?

  • Button within a movie clip not working

    Hiya,
    I have a movie clip within my swf website that is basically
    an icon that you roll over to produce the menu. The movie clip has
    coding inside it to produce the rollover effect. This is as
    follows:
    stop();
    this.onEnterFrame = function(){
    if(rewind == true){
    prevFrame();
    this.onRollOver = function(){
    rewind = false;
    play();
    this.onRollOut = function(){
    rewind = true;
    Whilst this coding works fine for this movie clip, for some
    reason the buttons within the movie clip that appear as you
    rollover them will not work when pressed. I am trying to get them
    to navigate the main timeline, i.e. coding as follows:
    on (release) {
    _parent.gotoAndPlay("home")
    _parent should be correct, I've tried it without and with
    _parent._parent however still it has no effect. From what I can see
    everything should be working fine.
    Is there some reason why buttons will not work within this
    sort of roll over effect movie clip?
    Thanks for your help.

    you can't assign mouse handlers to a parent movieclip and
    expect a child movieclip to respond to mouse events: the parent
    will intercept those events.
    to remedy, either assign all your mouse handlers on the child
    generation movieclips or use a hitTest() for one of the
    generations.

  • Multiple movie clips within a button

    I'm having trouble with working a movie clip played one after another within a button. Can anybody help? or is there a simpler way of getting multiple movie clips to play?
    for my project, when you hover over the button and vines grow out. currently, i have one working in a button but i can't seem to get other vines to work.

    use a movieclip (or sprite) button.  you can then control the child movieclips with actionscript.

  • Making Button links within a movie clip

    I am attempting to learn more Flash in general and
    actionscript in particular. I have created a flash piece that
    consists of 4 buttons within a movie clip that is being masked by
    another movie clip. One movie is the set of 4 buttons. The other
    movie is a "spotlight" that moves with the cursor. As the spotlight
    shines on each button, the button's text changes color and is "lit
    up".The Over state of each button is set to cause the button to
    change color. When I put a keyframe in the Down state of each
    button in order to add actionscript to create the action that makes
    the button clickable to take the viewer to a web page, it tells me
    that no actions can be given to this Down state. If I try using
    Behaviors to accomplish the same thing, it tells me that Behaviors
    are not supported. If I put actionscript into the actions layer of
    the timeline, it does not do the required action, i.e. clicking on
    the buttons leads nowhere. I have tried moving the actionscript
    before, between, and after the setInterval and setMasker
    actionscript that controls the interaction between the two movie
    clips (which work perfectly). I have tried inserting an actions
    layer into the button movie clip--same result--nothing. I have
    tried putting the actionscript in the second frame of the actions
    layer (both in the main timeline and in the movie clip), all to no
    avail. I did give each button an instance name and used them in the
    actionscript.
    Here is the actionscript I am using for one of the buttons:
    book.onPress = function(){
    book.getURL("http.//www.bainbridge.wednet.edu");
    I do not get an error message with this actionscript. I just
    don't get sent to the web page. I am using Flash 8.
    What else I should be doing? Is this a problem because the
    cursor is already attached to an action? I am sure that this must
    be possible, if only I knew more.
    Thanks for helping.

    do you have the actual mc identified as ( book ) on the root
    as well as the code i posted above? if so, are the code and the mc
    on the same frame? also you should note that the code posted above
    is meant to be placed on your root time line, not directly on the
    mc identified as ( book ). one more thing: you must target your mc
    ( book ) correctly.
    target like this:
    IF YOU ARE ON THE MAIN TIME LINE ( _root ):
    // if ( book ) is setting on the _root already then your
    target path is simply book.onRelease.
    // if ( book ) is setting inside another movieclip on the
    _root, find out what movieclip ( book )
    // resides in. that will now be the first part of your target
    path.
    // next find out if ( book ) resides in yet another
    movieclip. if so, that will be the next part of
    // your target path.
    // continue this until you reach ( book ). the entire path
    you took to reach ( book ) is your
    // target path.
    // you can also click on the target icon in your actionscript
    pane to insert a target path for
    // your movieclip.
    here is an example in which ( book ) resides inside another
    movie clip ( yourMovieClip ) on your _root:
    yourMovieClip.book.onRelease = function () {
    getURL("
    http://www.cnn.com/");

  • Referencing HTML page from within a movie clip

    Hi
    Hope someone can help with this.
    I have a simple horizontal scrolling gallery of 24 thumbnails
    in Flash, the thumbnail images are loaded into the boxes using
    actionscript. I would like each thumbnail to link to a html page of
    my choice. There is a movie clip instance called panel with the 24
    buttons inside it and on the first button as a test I've placed the
    following action script:
    on (release) {
    getURL("team.html","_self");
    When testing this movie from within Flash (CTRL, ENT) the
    button links to the html file (which is in the same folder as the
    SWF) with no problem. The problem is when I preview the page in a
    browser and try to click on the first button nothing is happening.
    I've tried it in both IE7 and Firefox with the same result.
    The flash thumbnail clip is placed as a flash object into a
    html page using dreamweaver.
    I'm sure this is something simple such as navigating the
    timeline but I've tried a few things like _root. but still no joy.
    Hope someone can help.
    Thanks, Jo

    Try
    on (release) {
    getURL("
    http://site.com/team.html","_self");
    }

  • How to remove a function on the main timeline within a movie clip

    How do you remove a function that is coded on a frame in the main timeline from within a movie clip?  I tried this, but no dice:
    infoGraphicDisparity.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene);
    function fl_ClickToGoToScene(event:MouseEvent):void
        parent.removeEventListener (Event.ENTER_FRAME, parent["enterFrameHandler"]);
        MovieClip(this.root).gotoAndPlay("disparity");
    this is the event I am trying to remove:
    stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
    any help would be appreciated as always.
    Thanks!

    from any frame (that executes after enterFrameHandler is defined) in any display object in the display list
    stage.removeEventListener(Event.ENTER_FRAME, MovieClip(root).enterFrameHandler);

  • Overlapping buttons within a movie clip

    I am using Flash CS3. Within a movie clip, I have a button
    symbol on one
    layer and an invisible button, which covers the whole canvas,
    on another
    layer. Regardless of top-down order, the big invisible button
    works and the
    button symbol (simple text rollover with link) will not work.
    If I put the
    button on the main timeline it works fine.
    What's the solution or what is a good way to have canvas
    coverage, plus
    individual links?
    Thanks for the help.

    See, I thought of that. It only works on the main timeline,
    not within the
    movie clips.
    If you look at
    http://www.graceweb.us/flash/precepts_090310.swf
    and mouse
    over the right-hand rectangle you'll see the top "blog" link
    is on the main
    timeline, the second blog link is two MCs deep, and the
    bottom two links are
    in the same clip as the invisible button.
    The actual FLA is at
    http://www.graceweb.us/flash/precepts_090310.fla
    Thanks again for the help
    "NedWebs" <[email protected]> wrote in
    message
    news:gpqvok$d45$[email protected]..
    > Place all of you individual links/buttons on a layer
    above the stage one

  • Pause & Play Animation When i'm using movie clips- filters

    Pause & Play Animation When i am using movie clips-
    filters
    Graphic and movieclips are using for my animation
    When i Press the pause the movieclip animation not stopped.
    Any way to apply the filters on graphic
    I want to apply the filters for particular graphics or movie
    clips. with navigational button working.
    Please help me.
    Thanks
    S.Satheesh Kumar

    Audio on the timeline, especially stream, tends to play very reliably. Is this project under any NDA or can you provide a FLA to examine? Let me know if you want to private message it and I'll shoot you a message.
    What version of Flash Player are you targeting and is this AS2 or AS3?

  • Markers on clips don't move with project when switching media drives

    Here's an odd one. I'm editing a project in Premiere Pro CS6 and in order to avoid carrying drives back and forth between two editing locations, I cloned the footage drive and have one duplicate drive in each location. I'll call them location A and B.
    I have no problem relinking clips when I move back and forth from location to location. That's all working great, as expected.
    When I am reviewing clips at edit location A, I've been placing a marker on the hero moments to make them easier to find later when editing. The strange (or perhaps perfectly normal) thing is that when I move to edit location B and relink the clips, all of my markers that I made at location A are gone.
    The same thing happens when creating markers on clips at location B. When I move to location A, the markers made at location A are there, but the new ones added at B are gone... until I return to location B.
    In other words, it seems like markers are not saved as part of the project, but are saved within each clip file. If that's true, what I'm experiencing would make sense. Even though I'm relinking the clips when I change edit locations, the markers are part of the footage files on each of my duplicate drives and do not move with me when I change locations.
    I just wanted to confirm this is "how premiere pro works," or see if there is a preference checkbox or workaround I'm not aware of. Maybe I've found a bug? If this is just how it is, I'll have to come up with an alternate way to mark footage I'm reviewing, or just move the drives with me when I move, which I'd love to avoid.
    Thanks for any thoughs on this anyone has.
    Billy Sheahan
    Chicago, IL

    Wes, my deepest apoligies for not responding to your kind answer sooner. I had moved on, thinking it was just one of those things, until another editor colleague of mine, found my original question recently and emailed me to find out if there was a solution.
    It appears that even with Premiere Pro CC, copying the XMP sidecar files to the second media drive remains the answer. Sadly my editor friend did most of his pre-edit clip marking in one city and traveled several states away to begin the edit and when he arrived, all of his marks were, of course, not there.
    It would be great if somehow the metadata could be tied to the project, rather than the sidecar XMP files. Perhaps not technically feesible, but it would certainly make more sense from an editing standpoint to not have to be copying sidecar files every time you move to a edit location with duplicate media drives.
    I will most likely write a feature request to see if this can be achived in future versions of Premiere.
    Thanks again for your support and reply.
    Billy

  • Invalid clip on spiderman movie on Nokia N95

    Hi. Can anyone help me as i have just bought the new Nokia N95 and i have just gone to play the already downloaded Spiderman 3 movie and it plays perfectly for 5 minutes then beeps and say 'invalid clip. action cancelled'. I have tried it several times now and it still starts well and then stops. Any ideas???

    Do you have N95-2 with spidey or you just put the movie to the phone yourself?
    There must be something interrupting the playback.

Maybe you are looking for