Movieclip rotation duplication

Hello all,
I have been battling with this for some time now so some
advice would be so great!
I need to create a button that will show a movieclip on the
centre of the stage but also when you click the same button many
times the movieclip on the stage loops changes till the user has
the one they want and the images will loop in order. i.e. image1,
then image2, then image3, then image1 again etc. they can then drag
this image to somewhere on the screen, leave it there, and then if
they want another image - do the same process. I have the drag and
drop thing down, as well as a theory for the looping of the
movieclip choices (jumping along the buttons movieclip timeline).
My problem is the duplication of the main movieclip. for
example, say they have chosen their movieclip from the 3 available
and have dragged it to the position they wish, now how can I make
it so that if they click the button again they get a new rotation
of movieclips as appossed to changing the one already on the
screen? and also how do I go about placing the movieclip options in
the centre of the screen when the button is clicked to begin the
choice of movieclips.
I really hope that makes sense to someone, it's quite
complicated to explain
Any help greatly appreciated, Anna

gvbrown49686,
> Surely I can calculate the new y position, and make
> adjustments... but... if there's some easier way, I'd
> rather do that.
The rotation of any object depends on its registration
point, which you
can edit by entering the timeline of this movie clip. You'll
see a little
plus or cross -- that's the registration point -- and you can
select
everything and drag or nudge your artwork with the arrow
keys.
> Is it possible to just flip the movieclip vertically?
Sure thing. Change the y-axis to -100%.
movieClipInstanceName.scaleY = -1;
David Stiller
Co-author, Foundation Flash CS3 for Designers
http://tinyurl.com/2k29mj
"Luck is the residue of good design."

Similar Messages

  • Unwanted movieclip rotation

    Not sure if this is a bug or what, but I've a bit of flash
    with two buttons for going up and down a list of movieclips, 4 of
    which are displayed on screen at one time.
    When I click the Down button, it scrolls the list by doing a
    loadClip() to re-load each clip at its new position, and bring in
    new clips as the old ones "scroll" out of sight. It also loads
    other mc's related to the top clip in the list.
    Under normal circumstances this works fine, but if a mad user
    (or tester) repeatedly clicks quickly on the Down button, some of
    the images acquire a 90-degree rotation (evidenced by tracing the
    value of movieclip._rotation).
    Weird, because I'm not setting rotation anywhere at all. I
    guess it's something to do with multiple loadClips on the same mc
    before it is finished the previous load. Not quite sure how to
    handle this properly.
    I put in a delay on the button (using setInterval) so that
    once clicked, it could not be clicked again for a further second or
    so, which helps to reduce the problem, but I wonder if there is a
    way to properly block a loadClip if one is already in progress for
    the same movieClip. Because the loadClip is asynchronous and the
    clips are being loaded from a webserver, it makes blocking tricky.
    I thought about cancelling the loadClip in the .onLoadStart()
    event if the same clip is already loading but not finished, but
    that would put the scrolling out of sync, so probably what i need
    to do is disable the Down button until all 4 loadClips have
    completed using some kind of counter, decremented on each loadclip.
    What would be nicer would be to have Flash do it
    automatically using a queuing system such that the loadClip events
    on the same mc are queued up so that one starts only after the
    prior one finished (or failed).
    Scenario:
    4 Movieclips named mc1 mc2 mc3 mc4 and a cliploader called
    mcl.
    mcl.loadClip("name1",mc1);
    mcl.loadClip("name2",mc2);
    mcl.loadClip("name3",mc3);
    mcl.loadClip("name4",mc4);
    Ok, this is fine,
    But if it so happens that this occurs because the user clicks
    too quickly...
    mcl.loadClip("name3",mc3);
    mcl.loadClip("name4",mc3);
    Then things get confused because two different clips are
    trying to be loaded into the same movieclip (mc3) almost
    simultaneously.
    The worrying thing is sometimes it is a different mc than the
    one being loaded that is rotated by 90 degrees. Hmmm...
    One time I also got a "security violation ... out of sandbox
    " error (something like that) in the trace window suggesting some
    memory overlflowed somewhere.
    My question is, has anyone encountered this before, and why
    should it only be the rotation that is affected?
    Brian

    there's no bug of which i'm aware. you probably have a coding
    issue.
    copy and paste the essential part of your code that displays
    the issue.

  • Movieclip rotation... duh

    Alright -
    I have a "movieclip", which is an imported drawing from
    illustrator. I want to rotate this 180 degrees, but keep the y axis
    positioning at the right upper corner (rotating seems to keep the y
    positioning at the original upper right corner, which is the bottom
    right corner after rotating). Surely I can calculate the new y
    position, and make adjustments... but... if there's some easier
    way, I'd rather do that.
    Is it possible to just flip the movieclip vertically?

    gvbrown49686,
    > Surely I can calculate the new y position, and make
    > adjustments... but... if there's some easier way, I'd
    > rather do that.
    The rotation of any object depends on its registration
    point, which you
    can edit by entering the timeline of this movie clip. You'll
    see a little
    plus or cross -- that's the registration point -- and you can
    select
    everything and drag or nudge your artwork with the arrow
    keys.
    > Is it possible to just flip the movieclip vertically?
    Sure thing. Change the y-axis to -100%.
    movieClipInstanceName.scaleY = -1;
    David Stiller
    Co-author, Foundation Flash CS3 for Designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • Actionscript 2 help needed on rotating movieclip

    I need help with the "stopping" of a movieclip rotation.  I think this would be easy for you Flash gurus but impossible for me.
    Here is the description.  The code below shows a movieclip rotating after mouse click but i want it to stop in place after 60 degrees.  Basically I need it to rotate 60 degrees after every mouse click and stop.  The "trace" function is there so i know something will happen when it rotates a certain degree.  Right now it rotates continually after the mouse click.
    mc.onRelease=function(){
         mc.onEnterFrame=function(){
              mc._rotation=mc._rotation+=10;
              if(mc._rotation==60){
              trace("HIT");
    As a bonus i would like the rotation of every 60 degrees to ease in and out.  Thank you in advance for any help you can give me.

    When the _rotation value reaches the 60 degree mark, you need to delete the onEnterFrame delete mc.onEnterFrame;.
    There is only one position where the _rotation value will == 60, so if the intention is to stop it at every 60 degrees, then you'll need to change the conditional to be...
    if(mc._rotation%60==0){
    So....
    mc.onRelease = function(){
         mc.onEnterFrame = function(){
              mc._rotation = mc._rotation+=10;
              if(mc._rotation%60==0){
                 trace(mc._rotation);
                 delete mc.onEnterFrame;
    If you want to have easing, I suggest looking into using Actionscript tweening.  With steps of 10 there's little room to ease.

  • Moving a Movieclip towards its rotation?

    Hello!
    Basically, what I'm trying to accomplish is moving a movieclip towards the direction it's facing.
    I've been scoping around the net for different ideas on how to do it, but I've only found AS2 tuts.
    What I've done already is making the movieclip rotate around it's own center when the user presses either the left or the right arrow-key.
    What I'm now trying to accomplish is to make the movieclip move forward to the direction it is currently facing when the user presses up and vice versa for pressing down.
    Any ideas on how to do this?

    Yes this I did understand.
    But, the thing is, when I set these values, the player automatically spawns in the top left corner?
    The thing is.
    I still want the player to spawn in the middle of the screen, whilst allowing the player to rotate and move towards the rotation.
    How would I solve this with a Keyboard Eventlistener?..
    I'm already using a switch(e.keyCode) with the appropriate keyCodes.
    Like so:
    public function keyDownHandler(e:KeyboardEvent):void
    switch(e.keyCode)
    case Keyboard.LEFT: player.rotation -= 5; break;
    case Keyboard.RIGHT: player.rotation += 5; break;
    case Keyboard.UP: player;
    The "update" function is exactly like yours, but the thing it is doing now, is setting the players X value in the top left corner..

  • BitmapData.draw() failing to draw entire MovieClip

    Hi, all;
    I'm trying to do some lean blitting for an object that rotates by rotating it once at startup and capturing a BitmapData snapshot of each 5 degrees.  The problem I'm having is that the draw() method of the BitmapData object is only picking up pixels in the MovieClip that are below and to the right of the registration point.  If I change the MC so that the registration point is in the top left corner, I sometimes get what looks like most of the pixels, but the entire object rotates into and out of the frame, since it's rotating around the corner and not the center.
    Has anyone encountered this before, and if so is there a fix?
    Thanks;
    Amy Blankenship
    flexdiary.blogspot.com

    I think you're misunderstanding the question.  I am using a matrix to transform it, and that lower right quadrant of the MovieClip rotates perfectly as inended, but the rest of the object isn't captured as if it weren't there.
    Here's the code:
    package com.magnoliamultimedia.datastructures
    import flash.display.BitmapData;
    import flash.display.IBitmapDrawable;
    import com.magnoliamultimedia.datastructures.IChain;
    import com.magnoliamultimedia.datastructures.IChainable;
    import flash.geom.Matrix;
    import flash.geom.Rectangle;
      * RotationChain takes an IBitmapDrawable and rotates
      * it through 360 degrees, creating a BitmapDataLink
      * for each incremental rotation
      * @author Amy Blankenship
    public class RotationChain implements IChain
      //private storage for the chain entry point
      private var _defaultNode:IChainable;
       * Constructor
       * @param rotatingObj object to rotate
       * @param degrees number of degrees to rotate (must divide evenly into 360)
      public function RotationChain(rotatingObj:IBitmapDrawable, degrees:int=5, size:int=200)
       //first, check if degrees divides evenly into 360
       if (360 % degrees != 0) {
        throw new Error('Degrees must divide evenly into 360');
        //set to the default, so we still have a usable chain
        degrees = 5;
       var matrix:Matrix = new Matrix();
       var bd:BitmapData;
       var bdl:BitmapDataLink;
       var lastBDL:BitmapDataLink;
       var loops:int = 360 / degrees - 1;
       for (var i:int = 0; i < loops; i++) {
        /* Take "snapshot" of rotating obj with matrix applied.
         *  On the first loop, use the identity matrix.
        bd = new BitmapData(size, size);
        bd.draw(rotatingObj, matrix);
        bdl = new BitmapDataLink(bd);
        //check for any previous links that might have been added
        if (lastBDL == null) {
         //no? this is the default
         defaultNode = bdl;
        } else {
         //set up reciprocal arrangement with last node
         bdl.previous = lastBDL;
         lastBDL.next = bdl;
        //set this link as the last link
        lastBDL = bdl;
        //rotate next snapshot
        matrix.rotate(degrees);
       //connect the last link to the first link to make a circular chain
       lastBDL.next = defaultNode;
       defaultNode.previous = lastBDL;
      /* INTERFACE com.magnoliamultimedia.datastructures.IChain */
      public function get defaultNode():IChainable
       return _defaultNode;
      public function set defaultNode(value:IChainable):void
       _defaultNode = value;
    Is there anyone out there who does this kind of stuff?
    Thanks;
    Amy

  • Making a clock with hand pointers

    Hello macromedia flashers.
    im thinking of making a simple clock design and adding hand pointers that tell the time.but im no action script fan and i have a few questions to ask.
    a)how hard is it to add action script to the hand pointers?
    b)can i use the clock on my desktop to show time?
    Thank you.

    The difficulty of the task is dependent your ability and knowledge of using Flash.  In general it is not that difficult, but you need to become familiar with a variety of code to get it working such as the Date class and movieclip rotation property controls.  You should search Google using terms like "Flash analog clock tutorial"
    You can open/play an swf file on your monitor.

  • BlendModes of parent overriding children, but need to use parenting. Help!

    This is an age-old question, I know. But I am working on my first large-scale 3D flash project, which requires me (at least with the knowledge that I have) to do a lot of movieclip parenting in order to make it easy to move and rotate a large number of objects in 3D together, and around common anchor points. But the problem with this of course is that you can't have individual or different blendModes of movieclips with one or several parents. So what is my solution? I need independent blendModes, but I also need to use parents/children unless there is another way in Flash to animate a large number of movieclips around as if they were grouped together (obviously myMC.x = myOtherMC.x + 20; is not hard, my concern is having two movieclips rotate around a common point).
    So my question is this. How can I have independent blendModes and be able to easily animate objects in 3D? I've searched and searched and found nothing beyond "Well don't use parents then if you need blendingModes." I have to not be the only person the planet with this problem. What's the solution? Either there is a way to force or pass-through blendModes of children, or there is a way to animate a number of movieclips together without parenting them to something (the easiest way).
    Thanks!

    William,
    Many thanks for your response! First, let me say that I've watched many of your instructional videos. They've been incredibly helpful and I'm grateful you've made them available!
    Second, that pretty much is my set up! I've taken some screen shots... maybe there is another way or I am missing something obvious.
    This is how I want it to look when the user clicks the main help icon:
    They click on Advising or Events Management and get a list of all the documentation available:
    The two topics above are in my Parent project: EXi Help Hub
    which has Introduction.htm as its start page and default topic (similar to Index.htm)
    I created the link to the child project by highlighting Basic Features Online Help, right-clicking, and selecting add a hyperlink, then using the file browser,
    Browsed to the child project (CM) and selected its start page and default topic, which is also Introduction.htm (similar to your example above only we use just introduction as opposed to index, but if changing the name to index will remedy the issue, I'll do it in a heartbeat))
    After compiling it didn't make the path relative. So I updated it to .../CM/Introduction.htm
    Still didn't work...
    What am I missing? Is there a better way to accomplish this? We'll need separate projects for each software component and our product is being designed for responsive design so the help needs to be as well. Part of the reason we went with the RH11 upgrade.
    Again, many kind thanks for your time and help!!!
    Scottie "is my help pie in the sky" Gearing

  • Touch detection performance issue, iOS

    Hi,
    I'm experimenting with compiling simple app to use on iPad. The problem is when I try using touch controls performance drops significantly. FOr instance I render 10 bitmaps and control one movieclips rotation with a slider. When I touch the screen and move my finger the application freezes for a moment, skips frames. The more rapid my swipes are the longer freeze is. Am I doping something wrong? Or maybe it's the iOS compiler/hardware taht is at fault here?
    My first thought was that sampling touch input has very high priority and it chokes the player but I can't figure out how to lower the sampling rate so I can't check this theory.
    Any kind of input is much appreciated I reached a dead end here.

    Well flash cannot really compare to native applications, there are certain things we can duplicate but will never fully be the same. For example scrolling of any type on IOS Devices is allways 'choppy' So maybe this effect you are trying to achieve is one of those problems with flashh. Allthough i personally have never had a problem woth touch events or mouse events. May I see your code? (Private message it to me if you do not feel comfortable showing every one) there are a few performance things you can do to help imporve things.

  • Flash 5 speed in movieclip duplication

    this is my situation:
    I have a "cube" matrix containing boolean values: its
    dimension is 10 x 10 x 10.
    I have an isometric cube movieclip: it rapresents a matrix
    cell.
    In the render function of the matrix i clicle on the 3
    dimensions X, Y, Z; if the boolen value is true then I duplicate
    the movieclip and I put it in the right place (right coordinates).
    If I have few "true" value there's no problem....
    I tried to fill my matrix only with true values... the render
    funcion was very slow (about 2 seconds) for my purpose (it
    duplicates and creates 1000 (10 x 10 x 10) movieclips).
    is it a Flash limit (or Flash 5 limit!!!!!)?
    are new Flash releases optimized in movieclip duplication?
    thanks a lot

    create a new directory and save your fla (with a new name) in that directory.  restart your computer and then open that new fla in flash cs 5.5 and see if it performs better.

  • Help with rotating a movieclip please!

    How do I rotate a movieclip 360 degrees over a period of time?  Can I use "new tween" ?  I am trying to rotate the movieclip while it is moving from position y to y+50 (this is done using new tween)

    Yes, you can simultaneously rotate the object using another Tween that changes the rotation property of the instance.

  • Rotate Movieclip depending on its direction its traveling?

    hello, this is prolly a simple question..
    but i need help making my arrow object rotate in the direction its traveling, since  i have gravity on the object..
    my arrow is called ArrowMC.
    anyone?

    This is my code to move the arrow and with gravity. with array
    function UpdateArrow():void
        var TempEnemy:MovieClip;
        for (var ia:int =Arrows.length-1; ia>=0; ia--)
            TempEnemy = Arrows[ia];
         TempEnemy.x+=5;
            //start gravity + collision
            var vyT:Number = 0;
            var GravityT:Number = .5;
            vyT +=  GravityT;
            //GroundObject
            if (! GroundObject.hitTestPoint(TempEnemy.x,TempEnemy.y,true))
                TempEnemy.y +=  vyT;
            for (var i:int=0; i<10; i++)
                if (GroundObject.hitTestPoint(TempEnemy.x,TempEnemy.y,true))
                    TempEnemy.y--;
                    vyT = 0;
    i want the arrow to start rotate down when it comes down to the ground with gravity...
    i tryd TempEnemy.rotation = TempEnemy.direction..
    this dosnt seem to work...

  • Flash CC - Rotation on movieclip containing bitmap causes dramatical framerate drop

    I have a 850x850 bitmap inside a movieclip which must constantly rotate like a big wheel. When compiling for iOS the framerate drops from 24 to 8.
    Is there a way to increase performance without using cacheAsBitmapMatrix and without rotating the bitmap inside the movieclip but the whole movieclip itself?

    @Amy: Clever trick to solve the file size vs. performance problem. But I doubt it will get you far on a mobile platform with a 850x850 texture.
    Anyway at this point its not much not use to advise further without the big picture.
    If you`re serious about making a commercial game with Flash/AIR for iOSyou won`t be able to avoid stage3D
    http://wiki.starling-framework.org/manual/performance_optimization

  • How to rotate a movieclip clockwise and counterclockwise

    Dear friends,
    I have 2 movieclips. ro used for rotating and rect the movie that will be rotated.
    I want when clicking and draging the ro movieclip clockwise or counterclockwise, the rect movieclip is rotated clockwise or counterclockwise respectively.
    I allow the rect to be rotated according to mouseX and mouseY.
    but it dose not work as I need.
    I'd like you to show me a trick to achieve that as I want.
    Here is the code:
    var xPo:Number;
    var yPo:Number;
    ro.addEventListener(MouseEvent.MOUSE_DOWN, mouse_down)
    function mouse_down(e:MouseEvent):void
         xPo = mouseX;
         yPo = mouseY;
         ro.addEventListener(MouseEvent.MOUSE_MOVE, mouse_move);
    function mouse_move(e:MouseEvent):void
         if(xPo > xPo)
              rect.rotation += 10;
         else
              rect.rotation -= 10;
         ro.addEventListener(MouseEvent.MOUSE_UP, mouse_up);
    function mouse_up(e:MouseEvent):void
         xPo = mouseX;
         yPo = mouseY;
         ro.removeEventListener(MouseEvent.MOUSE_UP, mouse_up);
         ro.removeEventListener(MouseEvent.MOUSE_MOVE, mouse_move);
    Waiting for you help.

    just checked it quickly and made a change here:
    if(xPo > xPo)  to  if(mouseX > xPo)
    this does the colckwise anti clockwise thing but not exactly. May be this would help you go ahead.

  • Rotating and scaling a movieclip withing only its parent width and height

    Dear friends,
    I'd like to rotate a movieclip within specific area (its parent width and height) and it can't rotate out of it.
    How can I achieve that.
    When I say for exampe:
    mc.rotation = 10;
    it rotates also outside the parent area.
    How can I restrict it to only parent area.
    Thank you in advance.

    [OTTOMH]
    With each rotation step you could check the bounds of the rotating MC. If it's greater than the containing MC, you can calculate the scale factor and apply it to the x- and y-scale of the rotating clip.
    The clip would have to be deadcentre in the containing clip for this to work though.
    I suppose there would be some mathimatical way with most primitive shapes to calculate the width and height with a certain rotation, but I suppose this would be easiest.

Maybe you are looking for

  • BA activation - Error in Document level - cost center validaty date error

    Hi, We have activated business area for a perticular Cocode, The problem is, All the cost center were assigned to Business area from valid date 1.1.08, But when an entry is passed before the cost center validy date, that is if an entry is passed on 3

  • Mac computer won't open game

    My macbook pro won't open the game CounterStrike in steam. whenever i try to open it, it says the game quit unexpectedly. Process:               csgo_osx [4175] Path:                  /Users/USER/Library/Application Support/Steam/*/csgo_osx Identifie

  • JApplet calls a Class. This Class needs Input

    I am doing something in a JApplet. After the user click in a jButton called Execute, this JApplet use a class (Processing) to process some inputs which comes meanwhile this class (Processing) is running. I need some input from the user but not in the

  • Word '08 won't run after Mavericks install

    I Upgraded my iMac Intel to Mavericks and now my "08 version of MS Word will not work at all.  Excell is fine. Besides purchasing the newer version of Office, what can I do, please?

  • No Sound in Windows Boot Camp

    hey guys...i just downloaded windows onto my macbook pro via boot camp, and now I am getting no sound when windows is running. Any suggestions? My email is [email protected], you can reach me there, or on this post. I've been doing of searching on pr