Movieclip depths AS3

Hi
I have a movieclip on the stage called "scroller"
I also have some code which is sucking in external swfs from an array, and displaying and playing them consecutively.
Problem is, the external swfs are covering part of my "scroller" swf, which I don't want to happen.
How do I make the scroller swf stay on top all the time?  I've tried playing with layer heights, and child index settings, but I haven't nailed it.
Here's my external swf code - thanks for taking a look - Shaun:
// Array of external clips to use. Variable index refers to next clip to be displayed.
var clips:Array = ["001/.swf", "002.swf"];
var index:int = 0;
// Stuff to load swf files
var thisLoader:Loader = new Loader();
thisLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, doneLoading);
//loader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataOnLoad);
var thisMC:MovieClip = new MovieClip();
stage.addChild(thisMC);            // Add empty MC initially so the nextClip function can be generic
// Removes old MC and gets the next one, waiting until when it has initialized beore adding it to the stage
function nextClip():void {
    thisLoader.load(new URLRequest(clips[index]));
// Tell AS that the loaded file is a movie clip and add it to the stage.
function doneLoading(e:Event):void {
stage.removeChild(thisMC);
thisMC = MovieClip(thisLoader.content);
thisLoader.unload();
thisMC.addEventListener(Event.ENTER_FRAME, runOnce);
stage.addChild(thisMC);
fscommand("fullscreen", "true");
thisMC.gotoAndPlay(1);
// When thisMC has finished, play the next clip.
function runOnce(e:Event):void {
if (thisMC.currentFrame == thisMC.totalFrames) {
thisMC.removeEventListener(Event.ENTER_FRAME, runOnce);
index = (index + 1)%(clips.length);
nextClip();
// Call the nextClip function initially to get the ball rolling
nextClip();

Hey kglad
But scroller is a movielip I made in the IDE, so there is no loader - it just sits there permanently.  The external swf loading code is on the same timeline as what the scroller MC is.  Or am I misunderstanding your answer?
Thanks
Shaun

Similar Messages

  • LoadMovie- loading an external swf into movieclip in AS3

    Im extremely frustrated.........im trying to do something
    that was once very simple, which has now become over complicated
    unecessecarily.....i want to do a simple loadMovie type action and
    load an external clip into a movieclip called ph. my AS2 code would
    be:
    loadMovie("ExternalMovieClip.swf","ph");
    or
    on(release) {
    loadMovie("ExternalMovieClip.swf","ph");
    This no longer works. Can somebody tell me the new code that
    i would use with AS3 to do exactly what i just demonstrated? I
    honestly dont even want to touch AS3. The only reason i want to use
    it is because it makes skinning the components SOOOOOO much easier
    than AS2. That is the one and only reason im trying to convert to
    AS3. All the new load movie AS3 examples ive seen on google look
    like half a page long to do what i used to do in 2 lines. There
    must be a simpler and much easier way. I am a designer. It looks to
    me like Adobe went back to making flash for programmers only again
    leaving us designers out of the mix. Someone please help me, im
    desperate. I also have other old code that im sure im going to have
    to convert to AS3 for it to still work, and i may eventually need
    help with that as well, but ill stick with this loadMovie problem
    for now. Any and all help is appreciated. Thanks

    have a look here:
    http://www.smithmediafusion.com/blog/?p=381
    use this:
    var i =new Loader();
    i.load(new URLRequest(”yourSwf.swf”));
    myMC.addChild(i)
    myMC is the name of your clip on the stage.
    Dan Smith > adobe community expert
    Flash Helps >
    http://www.smithmediafusion.com/blog/?cat=11
    http://www.dsmith.tv

  • Movieclip Depth bug

    When placing a movieclip with a textfield behind (with lower
    depth) another movieclip with a bitmap, the movieclip with the
    bitmap should cover the textfiled completely right? Well, it only
    covers the textfield 96%, the textfield kind of interferes with the
    bitmap, its possible to kind of see the shape of the text through
    the bitmap.
    When using the "low" quality setting the problem dont happen.
    I figure there is a bug in the smooth operation in the rendering
    process.
    Everything was created dynamicaly with actionscript 2 (flash
    8). The textfield is with embedFonts=true and the bitmap was
    created with BitmapData.
    Anybody seem similar problem? Any comments apreciated...
    Thanks
    Mario

    (i hope that isn't me being credited with an obviously false statement like, "..keep all my movieclips onto 1 layer/mother mc to speed up the flash display engine".)
    anyway, if you want to add something to the top of the displaylist in a parent, use:
    parent.addChild(something);
    if you want to add something to the bottom of the display list in a parent, use:
    parent.addChildAt(something,0);
    if you want to add something betwen the top and bottom, you'll need to keep track of your depths or use some other artifice

  • Auto Centre MovieClip in AS3

    Hello again,
    Just a quick one. Using AS3, how would I ensure that a movieClip always stays in the centre of the stage on resize?
    Any help would be appreciated

    publish at 100%x100% and listen for the stage resize event.

  • Actions-Movieclip in AS3

    Hi,
    I am Raj
    I just started to learn the AS3. I am very new to flash. My
    problem is ...... I created a Movieclip and want to give some
    actions for that Movieclip but I was unable to open
    Actions-Movieclip window for actions in Actions panel. The
    Movieclip was clicked but It is simply showing Actions on the
    Actions panel. and not allowing any code to write in actions panel.
    But if i write frame actions. It is coming. so, my problem is to
    write actions in actions panel for movieclip. Please advice me soon
    anyone.
    Thanks

    You have to add an event listener to the movie clip and place
    the actions there.
    //Place this code on the first frame of the timeline
    movieclip.addEventListener(Event.ENTER_FRAME, frameFunction);
    function frameFunction(event:Event){
    //Code goes here
    }

  • How to add frames to timeline/ movieclip using AS3?

    Is it possible to add frames to main timeline or inside a
    movieclip by code written in AS3.

    Yes. Never use frames.
    You cannot make a template from a frameset file. The best you
    could do
    would be to have a separate template for each individual
    frame. That would
    be unthinkably silly, though.
    The decision to use or not use frames should be based on a)
    your site's
    needs, and b) your willingness to accept the potential
    problems that frames
    can create for you as developer and maintainer of the site
    and for your
    visitors as casual users of the site.
    I am down on frames because I believe that they create many
    more problems
    than they solve.
    Judging from the posts here, and the kinds of problems that
    are described,
    the kind of person most likely to elect to use frames is also
    the kind of
    person most likely ill-prepared fo solve the ensuing problems
    when they
    arise. If you feel a) that you understand the problems and b)
    that you are
    prepared to handle them when they occur, and c) that you have
    a need to use
    frames, then by all means use them.
    As far as I know, the most comprehensive discussions of
    frames and their
    potential problems can be found on these two links -
    http://apptools.com/rants/framesevil.php
    http://www.tjkdesign.com/articles/frames/
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "j.carney1987" <[email protected]> wrote in
    message
    news:fsnm01$d2g$[email protected]..
    > When you go to build a template with dreamweaver cs3 it
    won't let you add
    > any frames. Is there another way with out manually code
    it in?

  • How to dublicate the movieclip in as3.0

    Flash actionscript3.0
    How to dublicate the movieclip and attach the movieclip in stage.
    Thanks in Advance.

    Hi,
    You can do this in following way :-
    http://snipplr.com/view/12768/duplicatemovieclip-replacement/
    http://forums.adobe.com/message/2737929#2737929

  • Controlling embedded Movieclips through as3

    Hi everyone!
    I'm starting to learn actionscript 3 programming  and am in the process of trying to create a simple game but am having trouble getting flash to call up various movieclip states.I have a movieclip called "Player" and inside that movieclip, I have Player_Stand,Player_Hit, and Player_Walk...
    While I can get the master movieclip to move, I can't get it to play the embedded movieclips when I change states. I tried a more advanced method that did work where you stick all of the animations in one movieclip and then manually tell flash to advance each frame using gotoAndStop in a loop, but it would be easier to just have seperate movieclips that I could just call from a master movieclip file. I've tried various methods to solve this including having all of the movieclips on screen and then changing their visibility but that didn't work either. I'm sure it's something extremely simple that I'm overlooking and if you can point it out to me, I'd be very grateful!
    Here's the code, and I'm attaching the fla if anyone wants to look at it. I'm foregoing OOP and classes for the sake of simplicity at the beginning.
    http://www.filesonic.com/file/2609121934/FightingGame.zip
    package
              import flash.display.MovieClip;
              import flash.events.Event;
              import flash.ui.Keyboard;
              import flash.events.KeyboardEvent;
              public class Main extends MovieClip
                        public var player:Player;
                        public var rightIsDown:Boolean = false;
                        public var leftIsDown:Boolean = false;
                        public var upIsDown:Boolean = false;
                        public var downIsDown:Boolean = false;
                        public var dHitIsDown:Boolean = false;
                        public var wJumpIsDown:Boolean = false;
                        public var playerSpeed:Number = 2.5;
                        public function Main()
                                  init();
                                  addEventListener(Event.ENTER_FRAME,GameLoop);
                        private function GameLoop(event:Event)
                                  controlPlayer();
                        private function init()
                                  player=new Player();
                                  addChild(player);
                                  player.x = stage.stageWidth / 2 - 150;
                                  player.y = stage.stageHeight / 2 + 150;
                                  stage.addEventListener(KeyboardEvent.KEY_DOWN,keyPressed,false, 0, true);
                                  stage.addEventListener(KeyboardEvent.KEY_UP,keyReleased,false, 0, true);
                        private function controlPlayer():void
                                  if (leftIsDown)
                                            player.x -= playerSpeed;
                                            player.scaleX=-1;
                                            player.gotoAndPlay(20);
                                  if (rightIsDown)
                                            player.x+=playerSpeed;
                                            player.scaleX=1;
                                            player.gotoAndPlay(20);
                                  if (upIsDown)
                                            player.y-=playerSpeed;
                                            player.gotoAndStop(20);
                                  if (downIsDown)
                                            player.y+=playerSpeed;
                                            player.gotoAndStop(20);
                                  if (! leftIsDown||! rightIsDown||! upIsDown||downIsDown)
                                            player.gotoAndStop(1);
                        function keyPressed(keyEvent:KeyboardEvent)
                                  if (keyEvent.keyCode==Keyboard.RIGHT)
                                            rightIsDown=true;
                                  if (keyEvent.keyCode==Keyboard.LEFT)
                                            leftIsDown=true;
                                  if (keyEvent.keyCode==Keyboard.UP)
                                            upIsDown=true;
                                  if (keyEvent.keyCode==Keyboard.DOWN)
                                            downIsDown=true;
                                  if (keyEvent.keyCode==68)
                                            dHitIsDown=true;
                        private function keyReleased(keyEvent:KeyboardEvent)
                                  if (keyEvent.keyCode==Keyboard.RIGHT)
                                            rightIsDown=false;
                                  if (keyEvent.keyCode==Keyboard.LEFT)
                                            leftIsDown=false;
                                  if (keyEvent.keyCode==Keyboard.UP)
                                            upIsDown=false;
                                  if (keyEvent.keyCode==Keyboard.DOWN)
                                            downIsDown=false;
                                  if (keyEvent.keyCode==68)
                                            dHitIsDown=false;

    Here's just one observation of a situation that you probably don't intend.  If any one of the keys is not being pressed, you will be in frame 1.  Your only hope of getting to frame 20 is to hold down all the buttons at the same time.
                           if (! leftIsDown||! rightIsDown||! upIsDown||downIsDown) 
                                            player.gotoAndStop(1);

  • What is mean this words in as3

    i am new to as3 please help me about this words and how can i use it
    _root
    Math.atan2
    onEnterFrame
    Math.sqrt
    and the word " this " in as3
    *and what is the difference between this words ?
    _x and x
    _xmouse and mouseX
    _rotation and rotation

    _root (as2) = MovieClip(root)  (as3)
    Math.atan2 (as2) = Math.atan2 (as3)
    onEnterFrame (as2) = addEventListener(Event.ENTER_FRAME,somefunction);
    Math.sqrt (as2) = Math.sqrt (as3)
    this (as2) = this (as3)
    _x (as2) =  x (as3)
    _xmouse (as2) =  mouseX (as3)
    _rotation (as2) =  rotation (as3)

  • AS2 or AS3

    Hello, i'm somewhat decent in flash. I know AS2, i started
    learning AS3 today and find it to be more complicated and has so
    many extra steps in coding. Number one thing i hate is having to do
    all the code on the timeline, it will get so full of code if i have
    several buttons/movieclips that need code, no way to do code when
    you click on the button/movieclip in AS3 unlike 2.
    Would it be dumb for me to continue to use AS2 and learn more
    of it, or should i keep trying to learn AS3..... I don't do super
    complex stuff, mostly timeline navigation and animations.
    I also feel like there is way more room to make errors in 3
    because you have to type everything unlike AS2 where i was able to
    use the actions frame (use that plus tool that had the drop down
    menu).

    I'm in the same position, just starting to move from
    intermediate comfort with AS2 to a fresh beginning with AS3...not
    so easy for a guy who has so little logical thinking that I failed
    algebra in high school! I too am a bit annoyed by all the extra
    steps involved, such as having to add EventListeners for mouse
    events, when these really ought to be simplified and there by
    default, like in AS2. For example, why can't onMouseDown remain as
    a built-in behavior rather than having to take up 2 lines of code
    to insert it each and every time now?
    On the other hand, I am delighted at the way a lot of the
    inconsistencies in AS2 have been gotten rid of. No more having to
    remember when to put .x and when ._x, and so on. And now that I'm
    finally starting to learn how to use external classes, I see the
    beauty in it, and AS3 is custom-made for this. It seems that if you
    ever want to really advance in ActionScript programming, you need
    to start working with creating your own classes, and as long as
    you're going to learn those from scratch, may as well learn it in
    AS3.
    Putting AS on buttons was outdated practice years ago. It
    makes much greater sense to place all script on the timeline, with
    comments to separate it. Try programming the simplest game where
    objects are moving around and colliding, all controlled by script,
    and then a couple coded buttons control them. Bugs are inevitable,
    and debugging script when it's partly on the timeline, some is
    attached to main movie buttons, and some attached to movie clips
    inside movie clips, is a nightmare. Once you do scripting on the
    timeline, you'll never want to go back to the crude practice of
    attaching script to objects.
    Overall, it's a steeper climb than I'd have liked, to upgrade
    my knowledge from AS2 to AS3. But ultimately I think it's the best
    idea.

  • How to Load an external swf using loadmovie in AS3

    I need to create a button with script, on rollover load an external swf into movieclip in AS3.  This was able to create this in AS2, but I need to create this in AS3

    Thanks again Ned.
    Kenneth Russell
    graphic artist, Sr.
    Lockheed Martin - MS2
    2323 Eastern Blvd., Baltimore, MD 21220
    Phone 410.682.0554    Fax 410.682.0543
    From: Ned Murphy <[email protected]>
    Reply-To: [email protected]
    Date: Thu, 23 Jul 2009 19:08:25 -0600
    To: kenneth russell <[email protected]>
    Subject: How to Load an external swf using loadmovie in AS3
    In AS3 you use the Loader class to load external swf's and image files.  You
    should be able to find examples both in the Flash help files and these forums
    if you search.  If you aren't aware of how to code buttons in AS3, that can be
    found as well.  In AS3, just about any kind of interction involves the use of
    event listeners in combination event handler functions... in the case of a
    button rollover an example would be...
    btnName.addEventListener(MouseEvent.ROLL_OVER, overHandler);
    function overHandler(evt:MouseEvent):void {
         // your loading code or whatever
    >

  • New Tween onMotionFinished not working

    Hello everyone,
    I have :
    //-----Class File
    import mx.transitions.*;
    import mx.transitions.easing.*;
    class cTransition {
    public function cTransition(){
    public function AnimateScreen() {
         myINTween = new Tween(arguments[0], "_alpha", None.easeNone, 0, 100, .25, true);
         myINTween.onMotionFinished = function() {
                   AnimateScreen()
    //-----fla timeline
    var myMov:Object
    myMov = new cTransition ()
    myMov.AnimateScreen(myMov._childMov)
    This code is within a class and the problem is that the "myMovieToAnimate" movieClip animates the first time around but when the tween finishes, it does not call the AnimateScreen() function again, why is this.
    Any help here would be very much appreciated.
    Thanks

    I have a similar problem in that my function is not being called when onMotionFinished is called. Any ideas on what I am doing wrong??
    ****************************** MY CLASS ******************************
    import fl.transitions.*;
    import mx.transitions.Tween;
    class skitter.view.MainMenuView extends UIObject {
    private var sliderTween
    public function MainMenuView(target:MovieClip, depth:Number){
    ...constructor code...
    /** Animate Main Menu **/
        private function slideMenuItems(dir:Number):Void{
           var newLoc:Number;
            //To Make Sure Direction Calls Don't Call This Again Until Animation is Complete
            failSafe = true;
            // Move the Indicated Direction
            switch( dir ){
                case 1:
                    // Set New Slide Amount
                    newLoc = sliderStage._x + (mItemsArray[mItemsArray.length-1].getWidth() + offset);
                    // Move the Stage
                    sliderTween = new Tween(sliderStage, "_x", mx.transitions.easing.None.easeInOut, sliderStage._x, newLoc, speed, true);
                    break;
                case 2:
                    // Set New Slide Amount
                    newLoc = sliderStage._x - (mItemsArray[0].getWidth() + offset);
                    // Move the Stage
                    sliderTween = new Tween(sliderStage, "_x", mx.transitions.easing.None.easeInOut, sliderStage._x, newLoc, speed, true);
                   break;
                default :
                      break;
            failSafe = false;
            sliderTween.onMotionFinished = function() {
                trace("CALL REDRAW FUNCTION")
                Delegate.create(this, redrawMenu( dir ));
                //redrawMenu( dir );
        } // END slideMenuItems()
        /** Redraw Items on sliderStage**/
        private function redrawMenu( dir:Number ):Void{
            trace("\t** REDRAW CALLED");
            ...code to draw items...
    } // END CLASS

  • Garbage collector

    Bonjour à la communauté Adobe et merci pour les
    éventuelles réponses que je trouverai grâce à
    vous.
    Je relance je pense une fois de plus, comme sur de nombreux
    forums, le problème du Garbage Collector.
    J'ai un MovieClip crée dynamiquement. Ce MovieClip
    contient un objet vidéo contrôlé et géré
    dynamiquement via une classe (cette partie n'est pas bien
    importante je suppose); bref je voudrais pouvoir supprimer
    complètement ce clip, mais même après un
    "removeChild(clip)" et un "clip = null", j'entend toujours le son
    de la vidéo... ce qui me fait dire qu'il est toujours
    matériellement présent, mais pourquoi??
    mon code :
    var mavideo:MovieClip;
    mavideo = new monclip();
    addChild(mavideo);
    removeChild(mavideo);
    mavideo = null;
    System.gc();//j'ai même essayé de forcer le Garbage
    Collector, sans succès.
    Voilà donc ma question globale : comment supprimer
    complètement un clip en as3?
    Sorry for my bad english, but the question is : how to
    completely delete a MovieClip using AS3? If I remove a MovieClip
    which include a video, with the code below, i don't see the video
    anymore but i can hear the sound... Strange, isn't it?

    Bonjour à la communauté Adobe et merci pour les
    éventuelles réponses que je trouverai grâce à
    vous.
    Je relance je pense une fois de plus, comme sur de nombreux
    forums, le problème du Garbage Collector.
    J'ai un MovieClip crée dynamiquement. Ce MovieClip
    contient un objet vidéo contrôlé et géré
    dynamiquement via une classe (cette partie n'est pas bien
    importante je suppose); bref je voudrais pouvoir supprimer
    complètement ce clip, mais même après un
    "removeChild(clip)" et un "clip = null", j'entend toujours le son
    de la vidéo... ce qui me fait dire qu'il est toujours
    matériellement présent, mais pourquoi??
    mon code :
    var mavideo:MovieClip;
    mavideo = new monclip();
    addChild(mavideo);
    removeChild(mavideo);
    mavideo = null;
    System.gc();//j'ai même essayé de forcer le Garbage
    Collector, sans succès.
    Voilà donc ma question globale : comment supprimer
    complètement un clip en as3?
    Sorry for my bad english, but the question is : how to
    completely delete a MovieClip using AS3? If I remove a MovieClip
    which include a video, with the code below, i don't see the video
    anymore but i can hear the sound... Strange, isn't it?

  • Loading flex in to a flash

    Hi,
    Can i load the output of flex in to a movieclip using as3, like swf loading in to a movieclip?  Can anybody help me?
    Thnks and regards,
    Sreelash

    You could try using SWFLoader, you may just need to import the class in your Flash app first.
    http://livedocs.adobe.com/flex/3/html/help.html?content=controls_15.html
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • Some questions about graphic

    I am currently creating a tile-based map.
    Actually, I am trying to use Bitmap class to draw the tiles
    to the offscreen buffer. However, it seems that the help document
    only described how to load an image from external file but I want
    the image to be included in the swf.
    So my first question is how to load image from Library to
    Bitmap class.
    After a 30mins on thinking and searching and still don't know
    how to do it. I decide to clone the movie clip to first preview the
    map. But AS3 no longer use duplicateMovieClip() so I spend another
    30mins on thinking and searching but still didn't find any clue...
    My second question is how to clone MovieClip in AS3.

    give it a class name (which will be a subclass of the
    bitmapdata class) and then use the new constructor to create an
    instance of it.
    you'll need to create a bitmap of your bitmapdata object so
    you can add it to the display list.

Maybe you are looking for

  • Problemas com o Compartilhamento Familiar no Apple TV

    Na terça-feira, tive o prazer de comprar o aparelho Apple TV, porém só hoje pude conectá-lo à internet e começar a trabalhar em cima dele. O Compartilhamento de Fotos e conteúdo dos aparelhos Apple daqui de casa funciona perfeitamente, porém quando t

  • Sound and brightness buttons don't work, any suggestions?

    Hi guys, I just bought a MacBook Pro, and I can't control the volume and the bightness by the keyboard button. Do to so, I have ti to it by the icones in the top bar. How can I set these hotkeys on my keyboard? Any suggestions? Thank you and happy ne

  • Streaming HDTV media through E4200 to TV

    Hi all. Basically the problem is that the HD media steamed through the E4200 router has a significant lag on the TV. So details.. I have the Linksys E4200 wifi router and want to stream the HD video from my computer to TV. The connection schema is pr

  • New droid 4 owner

    I cannot find the password to enter into the wifi connection box. Can anyone help me with this?

  • My Question On Calendar and Date

    Hi, I am making a query to a table: T_HR_CONTRACT, which stores the labor contract of a company. END_DATE is a field of table T_HR_CONTRACT. Its type is date. Now, I need to search the contract end in each month. select * from T_HR_CONTRACT where fEN