Multiple movie clips in variable

Is it possible to have multiple movie clips inside one variable? I want to be able to just use var._totalframes instead of mc1._totalframes, mc2._totalframes, etc... Or is there another way I can avoid copying and pasting dozens of movie clips over and over? Thanks.

You can use the bracket notation in a loop to process multiple similarly named objects such as you described...
for(i=1; i<someNum; i++){
     something += this["mc"+ i]._totalframes // not clear on your intent
I can't be sure I am answerng your question when you mention copying and pasting movieclips.

Similar Messages

  • HitTest for multiple Movie Clip at the same time

    I have a movie it is a triangle.I duplicate it and I want to hitTest on the first triangle movie clip and I added 3 different line movie clips on the 3 side of triangle.I tried to write a code something like that.
    if(firstTriangle_mc.hitTestObject(line1_mc,line2_mc,line_3mc){
    trace("Ok");
    but I've got error.I think it is not allowed hitTestObject for multiple Movie Clips.So is there anyone have an opinion about it?What should I do?

    Here is another test for multiple movie clips for hitTestPoint but only the first work the others don't
    uc_mc.addEventListener(Event.ENTER_FRAME,hitle);
    function hitle(e:Event) {
    if (uc_mc.hitTestPoint(cub1,cub1Y,true)&&(cub2,cub2Y,true)&&(cub3,cub3Y,true)) {
      uc_mc.alpha=0.5;
    }else{
      uc_mc.alpha=1;
    The code above doesn't work.What should I do?

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

  • Targeting Multiple Movie Clips

    Hi everyone,
    I'm fairly new to ActionScript so I would really appreciate
    any help I can receive.
    Right, I have a Flash file which contains a movie clip with
    an instance called, 'contentHold_mc'. Inside this movie clip are 4
    individual movie clips with instances entitled, 'content1_mc',
    'content2_mc', 'content3_mc' and 'content4_mc'. I know these are
    not the best names for instances, but this is just for simplicty's
    sake. At present all movie clips run at the same time. I want them
    to run sequentially. On the last frame of the instance,
    'content1_mc', I want to stop the instance from playing and start
    playing the instance, 'content2_mc'. On the final frame on
    'content3_mc', I want to stop the instance from playing and start
    playing the instance, 'content3_mc', and so on until 'content4_mc'
    finishes playing. I have tried to use the tellTarget function
    without success and anyway, I believe this is now deprecated.
    Would anybody be able to provide me some guidance please as
    to how I can achieve the previous using the 'dot' notation?
    I have tried the using the code found at the bottom of this
    message in the final frame of the movie clip instance that I want
    to play first ('content1_mc'), however get a compiler error because
    of the preceding two full stops '..'
    Thank you in advance for any help I may receive with this
    query.

    Put a stop(); command at the first frame of each of the
    clips. On the last frame of the first clip put:
    stop();
    _parent.contentHold_mc.content2_mc.play();
    repeat as needed for each movie clip.
    Tell the first clip to play.

  • Scripting Download Progress for Multiple Movie Clips?

    I'd like to insert script in the example below that would indicate the download progress of two successive movie clips on a page. Any suggestions would be much appreciated. Thank you.
    import fl.video.FLVPlayback;
    import fl.video.*;
    explainer.source="movie1.flv"
    explainer.addEventListener(VideoEvent.COMPLETE, f);
    explainer.autoPlay= true;
    explainer.volume=1.00;
    function f(e:Event){
    var myVideo:FLVPlayback = new FLVPlayback();
    myVideo.source = "movie2.flv";
    myVideo.addEventListener(VideoEvent.COMPLETE, myHomePage);
    myVideo.autoPlay=true;
    myVideo.volume=1.00;
    myVideo.skin="SkinUnderPlaySeekStop.swf";
    myVideo.skinAutoHide=true;
    myVideo.skinBackgroundColor=0x000000;
    myVideo.skinBackgroundAlpha=0.1;
    myVideo.height=405;
    myVideo.width=720;
    myVideo.x=141.2;
    myVideo.y=115.4;
    stage.addChild(myVideo);
    var urlRequest=new URLRequest("ATRMAIN.html");
    function myHomePage(eventObject:VideoEvent):void
    { navigateToURL(urlRequest, '_self');}

    the flvplayback component has bytesLoaded and bytesTotal properties.

  • Play multiple movie clips - with sound

    Hello Forum members,
    I am a total new comer in terms of flash and action script,
    self-educated and Adobe forum and internet educated. I can now
    click a button and stop and start a movie clip, use attachMovie,
    and even mute sound in a movie clip (not video). I am currently
    using Flash 8, and waiting for CS3 (downloaded a trial, and like it
    better than Flash 8).
    Enough history - now to my question - I have an application
    that had 3 scenes. I read in some Adobe article
    "Flash Best Practices" that it was not a good idea to use
    scenes in an application. I converted my Scene 2 and Scene 3 into
    movie clips.
    I figured I could either put each movie clip on a separate
    layer in my timeline (mc_scene2, mc_scene3)
    and play them, one after the other (did not quite work, more
    later). Or...
    copy the timelines from the scenes, and add those frames to
    my Scene 1, making a application with both scenes staggered one
    after the other in the main timeline. Or...
    Keep Scene 1 and at the end of scene 1,
    attacheMovie("mc_scene2", etc) and when scene 2 was done play and
    or attach the final movie clip (mc_scene3).
    I could not figure out how to tell when mc_scene2 was done
    using the attacheMovie method, so I could then attach mc_scene3,
    etc.
    How would I be able to tell when one attached or loaded movie
    clip is finished, and then start the next one?
    Or what is the suggested way to use actionscript to load a
    movie, play it, and when the clip is done, load and play the next,
    etc.
    Thanks for a good forum,
    eholz1

    Hello Again - I guess there is much that I do not understand.
    I followed the tip above - or so I thought.
    I have "buttons" on my movie clips that play the clip when
    clicked.
    I have placed stop actions in frame 1 of each movie clip.
    I tried placing mc_scene2 and mc_scene3 on their own layer
    in the timeline,
    and put the code above in my actions layer (Scene 1).
    it seems that nothing really works - the _visible property
    seems not to work,
    etc - I must be doing something wrong. What layer should the
    two mc's be
    placed?
    Thanks for the info
    Eholz1

  • Single droptarget for multiple movie clips

    I have a movie clip which i use as a drop target. And I have four additional movie clips which can be dragged and dropped into the droptarget movie clip. But when I place a movie clip into a droptarget and I drop the second one too, the droptarget for the second one becomes the first movie clip but not the actual droptarget movie clip.
    Please suggest.

    Thank you for the reply. Can you give me an idea what the below code does?
    mainContainer is a movie clip. mc1, mc2 are three movie clips
    mainContainer.addChild( mc1 );
         and while dropping mc2
    mc2._droptarget - what this will refer to?

  • Multiple Preloaders for Multiple Movie Clips

    Designed in Flash 8, the site's timeline is all in Scene 1
    and is comprised of an introduction, which contains a short video,
    and 6 movie clip categories that the user selects to view. Since I
    want the intro to play as soon as possible, I'd like to limit the
    first preloader to just the video in the intro and not
    _root.getBytesTotal. Then, as the viewer watches this short video,
    the rest of Scene 1 movie clips will keep on loading. After the
    intro, the viewer will choose which of the 6 categories to view.
    These categories are identified with buttons which play the
    particular movie clip. Since I don't know the order of the
    categories they will select, I thought there should be a separate
    preloader for each category. Hopefully, after they view a category,
    the rest of the categories will have loaded and the loading time
    will be nil. The design for the preloader is comprised of a status
    bar and a percent loaded. Is there a way to limit the
    _root.GetBytesTotal to specific frames? I know I could break these
    categories up into separate SWF files but then I loose the
    advantage of one loading while another is being viewed.

    MovieClipLoader is a built in class of functions that will
    allows you to easily load Media (swfs/jpgs) from external sources.
    This will create a MCL object
    var mcl:MovieClipLoader = new MovieClipLoader
    We want the MCL object to receive events for any movie that
    is loaded into the main timeline
    mcl.addListener(this);
    Ok. now we have a movie clip loader that is able to recieve
    events. Since we want to show the progressive download and want to
    do something with that content after it loads, we need to declare
    two event handlers onLoadProgress and onLoadInit. onLoadProgress is
    pretty straight forward. onLoadInit executes it's action as soon
    all of the AS on frame 1 of its time has finished loading. In this
    case, we want two different things to happen. 1st, load the first
    clip and show it.... 2nd, load all remaining clips into the buffer.
    But first, lets declare those next...
    function onLoadProgress( target:MovieClip,
    bytesLoaded:Number, bytesTotal:Number):Void {
    // standard preloader code goes here
    function onLoadInit( target:MovieClip ):Void {
    // display the clip - this will be as easy as just calling
    our loadClip function for the mcl...more on that in a minute
    // If you want something special to happen, i.e. movie fades
    in or a mask is applied to it, you'd do that here.
    Now all we need to do is call the loadClip member function
    for the MovieClipLoader. Just replace the two parameters with the
    location of the swf and then the name of the instance you want it
    to load into
    mcl.loadClip( "myswf.swf", targetMovieClip );
    The other movie clips are now a breeze as well. For each
    button, just add an on(release) or onRelease = function (depending
    on your situation) to just call that mcl.loadClip() line from up
    above. Just change the movie you want loaded.
    Let me know if you need more help...

  • Multiple Movie clips and rollovers

    Hi, I need some help. I am putting together a flash file with
    3 movieclips. I have three movie clips I made - one for each of the
    3 big circles. When they roll over the other circles are supposed
    to disappear under the circle that they have their mouse on. I
    placed all 3 movie clips on the first scene, but when they roll
    over one of the circles the other circle movie clips stay there
    while the other one runs on the mouse over. I need the other ones
    to disappear. You can view what I have so far:
    http://www.feeco.com/Portals/0/encap.swf.
    If you need to see my fla file I can email it to you. Thanks!
    Stephanie

    use:
    stop();
    yourplaybutton.addEventListener(MouseEvent.CLICK,playF);   // replace yourplaybutton with the name of your play button.
    function playF(e:MouseEvent):void{
    play();
    /* Click to Go to Frame and Play
    Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and continues playback from that frame.
    Can be used on the main timeline or on movie clip timelines.
    Instructions:
    1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
    button_19.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_15);
    function fl_ClickToGoToAndPlayFromFrame_15(event:MouseEvent):void
        gotoAndPlay(2);
    /* Click to Go to Next Frame and Stop
    Clicking on the specified symbol instance moves the playhead to the next frame and stops the movie.
    button_20.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame_6);
    function fl_ClickToGoToNextFrame_6(event:MouseEvent):void
        nextFrame();
    I also have added a keyframe to the end of my actions to stop(); this does not appear here with this code but on a separte screen but under the same actions folder the stop works just as I want to the last movie clip stops at the end
    Just can not figure out how to get the play to not start over from begining but to continue.

  • Playing multiple movie clips one after other on main timeline

    Excuse the probably simple question but I'm just starting off with Flash.
    I have imported a few video trailers directly into flash and saved them as movie clips.
    I want to be able to insert these movie clips onto the main timeline and play them one after the other, repeating once they have all played.
    On the main timeline I have set a layer for each clip and a keyframe where the clip is inserted for each layer.
    When I go to play the flash file, it is showing the first frame from each movie file and then moving to the first frame of the next movie file.
    What do I need to do to make flash play the entire movie file in that specific frame before moving to the next frame where the next movie file is and playing all that movie?
    Sorry for what is probably a simple thing to ask.
    thanks

    Create an actions layer on the main timeline and place stop(); commands on that layer in each frame where a movieclip resides.
    Within in each movieclip, at the end (last frame) you want to tell the main timeline to play(); so that it moves to the next frame (where it will stop because of the stop() commands you add).
    So at the end of each movieclip you will put either:
    for AS2:  _parent.nextFrame();
    for AS3: MovieClip(parent).nextFrame();
    For the last movieclip in the lineup you will replace nextFrame() with gotoAndStop(1);

  • How to combine multiple movie clips from iphone 4 in iphoto 09

    I have multiple videos taken from iphone 4 downloaded to iphoto 09. How can i combine them all into one movie?

    We, as you know, are only users - we can not answer any "why" questions - only Apple knows why - we can sometimes answer How to questions - How to is use iMovie
    LN

  • Tweening properties of multiple movie clips

    My problem is that all of these movieclips are acting as one
    massive movieclip. when you rollover any one of them, they all
    change their alpha property. what do i need to change in this code
    to make each clip work independently with onRollover and onRollout?
    I want to be able to rollover any one of them and just have that
    particular movieclip react.
    thanks for your help!

    Thanks!! that works perfectly!!

  • Need help loading multiple movie clips.

    Hello forum members,
    I've run into a bit of an irritating problem and perhaps
    someone can clue me in to the answer.
    I'm creating a SWF which uses loadMovie (I've also tried
    creating a MovieClipLoader instance and using instance.loadClip) to
    bring in 2 other SWFs.
    See below AS in first couple frames of main movie's
    time-line:
    First movie:
    this.createEmptyMovieClip("mcToolbar", 10);
    with (mcToolbar)
    _x=8;
    _y=68;
    loadMovie("toolbar.swf",mcToolbar);
    Second movie:
    this.createEmptyMovieClip("mcWindow", 11);
    with (mcToolbar)
    _x=500;
    _y=60;
    loadMovie("textwindow.swf",mcWindow);
    This works great when opening up my main SWF in Flash Player
    and when viewing the movie in the published HTML web page.
    However, I'm using FlashObject to load my main movie to get
    around that annoying "Click to activate this control" thing.
    When viewing this version of the web page with my main SWF
    being loaded, I see the SWF load, then the first loadMovie
    loads....THEN the first loadMovie disappears and the second
    loadMovie loads and appears at the wrong X and Y coordinates.
    Any ideas?

    Ok, I know replying to my own post is odd on some forums, but
    anyhow:
    I've done some further testing and find that FlashObject
    isn't the problem.
    Looking at the AS code above, it is clear that the SWFs to be
    loaded must be in the same folder as the HTML web-page.
    However, my intent is that these small SWFs that are being
    loaded in by the main SWF will be shared by many other movies,
    therefore I'd like to stick them (the physical SWF files) closer to
    the root of the site (e.g. SiteFoler->flash).
    I see that my problem rears its ugly head when I try to
    reference these movies in my main flash movie as follows:
    First movie:
    this.createEmptyMovieClip("mcToolbar", 10);
    with (mcToolbar)
    _x=8;
    _y=68;
    loadMovie("../../../flash/toolbar.swf",mcToolbar);
    Second movie:
    this.createEmptyMovieClip("mcWindow", 11);
    with (mcToolbar)
    _x=500;
    _y=60;
    loadMovie("../../../flash/textwindow.swf",mcWindow);
    In the example above, my HTML page is 3 folders deep whereas
    the movies I'm loading in are 1 folder deep in the folder labeled
    "flash".
    By doing it in this manner, I get the problems I described
    above (first movie loads then disappears and second movie loads in
    wrong position).
    Any ideas as to why the physical location of the SWFs being
    pulled in is causing this problem? I'd like to try to avoid copying
    the SWFs to each place their being refrenced from as that could be
    a major maintenance headace.
    Thanks,
    Ben

  • Attach multiple movie clips

    Is it possible to do something like this:
    for(var nIndex=0; nIndex<10; nIndex++){
    this('loader'+nIndex)=new Loader();
    this('loader'+nIndex).load(url_array[nIndex]);
    addChild('loader'+nIndex);}
    i'm trying to create a loop to load multiple images.
    In the same vein how would you attach multiple movieclips in a loop like this?...
    I can do it in AS2 n=but not in AS3...
    cheers to any responders. J

    Yes it is possible to do that as long as 'this' refers to a dynamic class such as MovieClip(Sprite is not dynamic). You would also use square brackets instead of round:
    this["loader"+nIndex]
    I find it simpler to use an array to hold my loaders such as:
    var loaders:Array;
    loaders=new Array();
    for(var nIndex=0; nIndex<10; nIndex++){
        var loader:Loader=new Loader();
        loader.load(url_array[nIndex]);
        addChild(loader);
        loaders.push(loader);
    If you're publishing to Flash Player 10, you could even use a Vector instead of Array and have strong data typing.

  • Button "go to movie clip"

    Hi,
    I had previously posted a discussion entitled "how to link a
    button to a .swf file" and after some feedback, decided to try and
    create multiple movie clips (which were actually to be individual
    site pages) which could be accessed by clicking on a particular
    button. The last response I left was this:
    Okay, here I am again. So I created a movie clip called
    ENERGYwhiteTransparentBoxMC. On my Sustainability page, there is a
    button called Energy Services. When I click on that button, I would
    like it to go to the ENERGYwhiteTransparentBoxMC and begin (which
    is a page that is laid out identical to the Sustainability page
    only with a new image, new text, etc.)
    In my button movie clip which contains the Energy Services
    button (as well as 2 other buttons), I applied the following
    actionscript in the first frame.
    import flash.events.EventDispatcher;
    import flash.display.MovieClip;
    this.stop();
    function startMovie(event:MouseEvent):void
    this.gotoAndPlay(ENERGYwhiteTransparentBoxMC);
    btnEnergyServices.addEventListener(MouseEvent.CLICK,startMovie);
    A couple of things...
    1.) it doesn't work and go to the Energy Services movie clip
    when the Energy Services button is clicked.
    2.) my stop action that had previously been applied doesn't
    work (the links fade in and drop, the transparent box slides
    in...but they are supposed to stop and now they don't). So, I'm
    confused as to where to apply the stop action for this now.
    Am I close at all?????
    I would also add now that I wasn't sure what to insert here:
    this.gotoAndPlay(
    TextENERGYwhiteTransparentBoxMC);
    ...I would like it to go to the movie clip that is called
    ENERGYwhiteTransparentBoxMC.
    It might help to check out my original post as I explained it
    better there what I was trying to do. I last posted on it today,
    November 19. Any help would be greatly appreciated!
    Thank you!

    Just a suggestion: maybe the preloading could be done in a
    movie script of the new movie and the particular cast member sent
    to the new movie in a global variable.

Maybe you are looking for

  • Regarding Database performance for report creation

    Hi, Currently i have one database in that two schema one for table data and second for reports creation.But it is taking more time to display data because there is more load on first schema. I want to create second database for report schema .But i h

  • TS3989 Photo Stream won't upload to iOS devices

    My Photo Stream has 999 photo's currently showing in iPhoto, but my iOS devices stop uploading at 195 photos.  Is there a way to refresh the uploading process without having to turn off/on Photo Stream in the settings?

  • Hs_err_pid3108 error pls help me its really been there for a year now =(

    Here is the complete error file: # An unexpected error has been detected by Java Runtime Environment: # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x2309cfa0, pid=3108, tid=2896 # Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, shari

  • Error when compiling iOS app

    I have tried to start learning iOS development, however whenever i try to compile my app i always get a load of errors with the 4.2 frameworks this is the errors i keep getting http://pastebin.com/raw.php?i=kavS0zNA does anyone know what i have done

  • Uncaught Exception 268

    Hello, I just tried playing a multi player game of word mole which I havnt done for months and got the msg below uncaught exception: index 268 >= 268 After I click ok below the msg it would exit me. Does anyone know what this msg means and why it is