Tween problems in ActionScript 3.0

Hello!
I'm stuck with my problem and I have no idea what is wrong. I'm making movement of movie clip via creating new Tween in Action Script 3, Flash CS4 and it happens, when I mouse over button in another movie clip. The problem is that movement sometimes work perfectly, but sometimes it gets stuck in middle of movement and continues only if I mouse over again. Here is the code of function of first frame in main scene:
import fl.transitions.Tween;
import fl.transitions.easing.*;
function btnOver(I:Number) {
var tw: Tween = new Tween(somemovieclip, "x", Strong.easeOut, somemovieclip.x, I, 1, true);
Here is how I'm calling that function from another movie clip when I mouse over a button: 
function over(eventObject:MouseEvent) {
(root as MovieClip).btnOver(288);
btn.addEventListener(MouseEvent.MOUSE_OVER, over);
I have several motions like this - for each button different variable for x position (number "I"). I also have another movie clip playing at the same time, but it isn't connected with any of movie clips mentioned above. 
Does anybody have an idea what is wrong?
P.S.: I'm on Mac with latest flash player and movie works better in Windows - it has less mistakes, but still they happen very rare. Probably the problem is somewhere inside player or something like that?
Thanks!

It looks like the problem is that you only have one Tween instance to work with. If you start one tween and start another before the first has completed, the first one has to stop working because that one Tween instance has to jump over to the new tween that's just been called.
You probably want to set up an individual tween for each button. You might also want to look into using something like TweenLite/TweenMax instead of the built in Flash tweening. Have a look at: http://blog.greensock.com/tweenmax/

Similar Messages

  • AS2 swf problem under AS3 swf (probably Tweener problem)

    Hello. I have this problem for a days and it hasn't been soluted yet although I put it on couple of forums. I have 3 files: test.fla, file_as2, file_as3.
    The test.fla file is a typical Loader, which loads external swf files and shows them on the screen. After any key is pressed, the swf is deleted from the screen and loaded again.
    The file_as2 and file_as3 are the AS2 and AS3 compiled having a simple square animation (6 squares fading in from alpha 0 one by one) animated by caurina Tweener. If the file_as3 is compilated and loaded externally there is no problem (six sqares are fading in, after pressing any key the vanish and appear (loaded) again and again...). But if the swf as2 file is loaded, it shows the squares only once and after pressing any key and loading it again, it doesn't shows it at all.
    I guess it's Tweener problem, because when i trace it in AS2 file (onUpdate) it traces only at the beginning.
    How it's possible, that AS3 somehow stops all Tweeners in 2nd time loaded AS2 file?? How to fix it?? Sorry for my english, i left a link for these 3 files to find solution. Try it (test.swf) and then change path inside fla to load AS2 file... Thanks for any ideas.
    Link to download: http://www.filolozka.pl/zip/file.ZIP

    Instead of reusing the same Loader, try loading the AS2 movie multiple times using different Loader instances. Instead of using event listeners like normal, this should be easy to do because you can addChild each Loader instance, and when it is loaded it will automatically play. If you are able to load the AS2 movie multiple times at once and have it work for you, then the problem must be in the way that you removing the old movie, and reusing code to load the movie again.

  • [Flash 8] Problema de actionScript

    Hola, hace mucho que no me pasaba por aquí. Tengo un
    problema de actionscript:
    Un botón que necesito que al hacer clic la primera vez
    vaya a un sitio, y al voler a hacer clic vaya a otro sitio.
    Sólo me obedece la primera parte:
    BTN4.onRelease=function( )
    var active:Boolean = false;
    if (active = true)
    this.gotoAndPlay( "over" );
    else
    this.gotoAndPlay( "out" );
    Gracias y saludos,
    XL

    Hola de nuevo Xiskya, hacía bastante que no te
    leía...
    Bien, tu función tiene un problema y es que siempre te
    va a marcar la
    variable como false, ya que cada vez que entras en la
    función la defines
    como tal, además en ningún punto del código le
    cambias el valor, una posible
    solución sería:
    var active:Boolean = false;
    btn4.onRelease = function {
    if (active == true) {
    this.gotoAndPlay("over");
    active != active;
    }else {
    this.gotoAndPlay("out");
    active != active;
    Ten en cuenta que este código te irá alternando
    entre active = true y active
    = false, si quieres que sólo se ejecute una vez el false
    entonces sácale la
    línea de active != active; del condicional true.
    Espero que esto te sirva de ayuda.
    Un saludo, Álvaro.
    "xiskya_lucy" <[email protected]>
    escribió en el mensaje
    news:fnfjoe$d6r$[email protected]..
    > Hola, hace mucho que no me pasaba por aquí. Tengo
    un problema de
    > actionscript:
    >
    > Un botón que necesito que al hacer clic la primera
    vez vaya a un sitio, y
    > al
    > voler a hacer clic vaya a otro sitio. Sólo me
    obedece la primera parte:
    >
    >
    > BTN4.onRelease=function( )
    > {
    > var active:Boolean = false;
    >
    > if (active = true)
    > {
    > this.gotoAndPlay( "over" );
    > }
    > else
    > {
    > this.gotoAndPlay( "out" );
    > }
    > }
    >
    > Gracias y saludos,
    >
    > XL
    >

  • Tween Problem - Can Anyone help

    I have two loaded movies loaded into a main movie. I would
    like to perform an action in one movie by hitting a button in the
    other. Here is the basic setup
    var mc_location = _level0.movie_1.my_mc;
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    btn1.onPress = function() {
    new Tween(mc_location, "_alpha", Strong.easeOut, 100, 50,
    15, false);
    This is the basic setup where I am having a problem. There is
    a lot of other code and I would like to store all of it in an
    actionscript file for future editing. So I need to store the mc
    location in a variable. I have tried also to put the variable in
    quotes, so it reads like a string, but then the tween won't read
    it, even though a trace will. Any ideas.
    Thanks, J-Rad

    Correction. I tried to put the path that the variable
    represents in quotes. Not the variable itself. All clear? It must
    be late.
    Thanks again, J-Rad

  • CS3 Motion Tween Problem

    Hello all
    I have been developing a game using flash CS3. It involves a
    variety of objects, movieclips, buttons and motion tweens and a
    whole bunch of actionscript. The development has been coming along
    very nicely and I havent been experiencing many problems, until
    now. I was close to finishing the game (with everything running
    smoothly) and suddenly, the motion tweens on certain objects have
    become broken. instead of smoothly tweening the object flickers
    from on position to the next.
    This all happened after absolutely no changes had been made
    to the game source (.fla) file. What is strange is that even my
    previous versions of the game (dating weeks prior to this point) ar
    now experiencing the same flickering on motion tweens as in the
    current version.
    So, I have come to the conclusion that this is the result of
    perhaps a corrupt flash settings file. When I log off my PC (with
    windows XP Pro)and log back in to the same machine as a different
    user, the problem was solved!! horray.... that only lasted for a
    day though. Soon the same problem began again under the different
    user.
    Can anyone help me out?
    Thanks for the help,
    Codie

    My suggestion is to make sure you are using the current
    version of Flash Player. If that doesn't work, try finding a legacy
    version fo the Flash Player (since it used to work). If the legacy
    version solves the issue, contact Adobe and submit a bug.
    Personally I've never had such an issue. It is possible to delete
    your preferences. If I remember right, they are located in both
    your registry and on your hard drive. I don't recall where to find
    the things you need to delete, and I remember I had a hard time
    finding that information. Sorry I can't be more help.

  • Strange motion tween problem

    So I have been making an animation to a voice over for a project. Comes in at about 2000+ frames with each animations different "scene" location split into 16 layers.
    If I play the entire movie from start to finish my 2nd to last "scene's" motion tweens play really fast and repeat randomly.
    If I use a gotoAndPlay to the frame where this "scene" starts the motion tween plays as intended.
    The problem "scene" is setup like all my others with the "scene" being in its own movieclip on the main timeline, and then nesting other movieclips inside it. When I remove the tweens from the nested movieclips there is no movement issue, but obviously there is also no movement which I need.
    My fix so far has been to add a goToAndPlay on the first frame of the problem "scene", eg "gotoAndPlay(1895); above frame 1895" which plays the tween correctly but makes my audio stutter when it hits that frame. So is not exactly the desired effect.
    Note: when I say "scene" I don't mean flash scenes more taking about the different shots/locations of my animation.
    I've searched google for hours to try find a similar issues with no success. So really do appreciate any help or ideas from some more experienced flashers

    You're trying to have different slices fade in? If you just
    want the image,
    as a whole to fade in, import it and convert it to a
    MovieClip and fade in
    the clip.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Animation Tween Problem - Motion am I missing somthing..?

    Screen shots, a simple fly-in, keep move slowly, then fly out, but for some crazy reason Premiere keeps creating a tween that does not exist and adding a bounce that looks pants... this is very, very simple animation it surely should not be doing this, or am I missing somthing, equally I'd love to have motion splines can I switch them on as this would likely fix the issue...
    The mistery tween that does not exist...?
    The other Keyframe...
    If I add an additional manual tween, it just replicates the problem further, so I end up with two bounces I don't want. Any help would be peachy,
    Samantha

    Well found the linear option etc, right click, but cannot find temporal & spatail, it would just be nice to have a spline on the motion position. To be frank Premiere's behaviour is just being odd in gerneral Ann. It just lost keyframes on the button/Badge element. Well there was none there but the animation still remained uneditable. Going to reload the project, but think it's likely best I pop out to After Effects for the Motion Graphics, or it will drive me bonkers lol

  • Tween problem :S

    I'm trying my butt off with this one. I'm loading images in a
    movieclip with an xml. There are 2 buttons that I use to scroll
    left en right trough the images. Scroll-effect is animated with a
    tween class. Now there is a problem when a want to change my XML
    file (images). When the tween is active the XML loads but I can't
    see the images. I think there somewhene on the _.x of the
    movieclip. How can I unload temperary my tween? Or maby there is a
    better solution?
    allready many thanks!!!

    OK, it's pretty easy to get this effect (at least in my Flash CS6 and my computer, it does happen all the time I do the following):
    1 - Create new document with large size (let's say HD - 1920X1080)
    2 - Create a line that covers about 2/3 of the area.
    3 - Convert the line to a Symbol.
    4 - Move the line's anchor point to its basis, so its rotating as if it were an arm.
    5 - Create another keyframe at frame 30 and rotate the symbol about 1 degree.
    Now turn onion skin on and check the inbetweens Flash creates. They are not equally spaced (smooth movement).
    This problem seems to happen with both classic and motion tween, trying other methods, the only tool that gave me the desired results were bones.

  • CS4 AS2 Tween Problem

    Hi there,
    Wondering if anyone can help with a crippling issue in Flash CS4. In short, the post production company I work for asked me to redesign their website using the version that happened to be hanging round the office- Flash MX (circa 2002). Half way through the project we bought CS4 as the site is quite video heavy and MX isn't really set up for that.
    I've opened my mx file in the new version and all has worked well- however a couple of days down the line i'm now having major tweening issues on the pages i've created since upgrading.
    When transitioning between scenes (yes i know everyone hates scenes but it seemed right at the time) the classic alpha tweens that fade the new scene in seem to be 'paused' on the first frame when viewed as an SWF. All is fine when scrubbing through the timeline. As I designed the site and know where the buttons are I can click them, it's just they're not visible.
    I've done a lot of reading into this and have seen reports of similar issues with dynamic text elements not alpha tweening properly - but this is all of the layers that have a tween at the start. Sadly i'm really tight on time to get the site done as it's only a side project and i've got work building up.
    If anyone can shed any light on the situation I would be very grateful. I can supply the .FLA on request but it's 200mb so it's going to be a bit of a beast to send around.
    I've searched for things like 'tween conflict' 'alpha tween not working' 'classic tween error' etc to no avail.
    Thanks in advance.
    Jon

    Hi Jon,
    Does this sound like the problem you're encountering? http://kb2.adobe.com/cps/496/cpsid_49616.html
    (there are a few workarounds on the page)

  • CS5 Publishing Problem about ActionScript

    Hi ,
    I prepared a project and i can published it without any error.Action folder includes actionscript files.But when i decompile the swf file there isn't action folder and actionscript files are missing.Please help me it's too important for me.
    NOTE : On CS4 I didn't face a problem like this and i could see Action folder when i decompile the swf file.

    No ,as I say on CS4 I didn't face any problem but on CS5 this problem occured.
    NOTE : On CS3 there isn't any problem too..Only on CS5..

  • Classic Tween Problem!

    So I made a frame by frame animation of a guy waving and wanted to make the animation a little smoother. So I highlighted all of the frames and clicked create classic tween. But then I get a warning saying "Motion tweening will not occur on layers with ungrouped shapes or on layers with more than one group or symbol. Can anyone help me with this? Or please tell me a way to make my frame by frame animations smoother?

    Tweening can only involve one object.  If you happen to have multiple separate objects in the frame(s) you are trying to tween it will fail.  To do what I think you are trying to do you would need to have the objects being tweened on their own dedicated layers or as sublayers of other objects. 
    For instance, if you have an arm waving where the hand also moves relative to the arm, then you would want to have the hand be a movieclip within the arm timeline that runs separately from the arm but also remains positioned on the wrist.
    To do it with the frame by frame approach you would need to involve more frames into the animation and adjust the frame rate to compensate.

  • Motion Tween Problem

    I'm new with AS3 and am designing a tween that will have 6 or more tweens that  loop continuously in a series.
    How do I create the stop and go between each tween series, but still in a continous loop?  Please view this similar example
    Thanks and I'll apprecaite all replies!

    Based on what I saw in the example you only have to worry about managing one tween and then create 6 or more of those managed tweens.  The general scheme could be you have a tween with a finish listener that sets a timer with a somewhat random delay (between x and y seconds) that upon timing out sets a tween with a listener and so on and so on.

  • Motion tween problems?

    Im completly new to flash so im sure the answer to this is
    probably really simple. I need to create a banner/header that has a
    changing image. I followed the tutorial on adobe but my pictures
    dont blend into the next one they just switch after x amount of
    frames. How do I get them to gradually change into the next
    image?

    Apply a Tween to the next image as soon as it is loaded...
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    var myTweenAlpha:Tween = new Tween(nextImage, "alpha",
    Strong.easeOut, 0, 1, 3, true);
    where:
    nextImage is the new object that loaded
    0 is the alpha value starting
    1 is the alpha value ending
    and 3 is the time to do it in (sec)

  • Problem with actionscript window in Flash CS3 IDE

    The actionscript window doesn't open up for any frames on the
    timeline. When I press 'F9' or try to access via context menu the
    action window tab appears at the top in minimized form. No matter
    how many times I click on it or on the maximize button the window
    doesn't open up. I tried reinstalling Flash CS3 but it didn't help.
    Any help with this issue is appreciated.
    Thanks!

    Found a solution for this atlast ! Delete the Users/AppData
    folder for flash CS3 and things will be back to normal. It seems
    the Flash IDE screws somewhere while saving the local users
    settings. Clearing these settings restored my action window
    !

  • Simple (?) Motion Tween Problem

    I am unable to do more than one transition for a
    fade-in/fade-out effect. I'm trying to do a simple transition of 5
    different bitmap images, with each fading out, followed by another
    fading in, etc... I've tried saving the bitmaps as symbols in the
    library. Still no luck.
    Any suggestions would be much appreciated.

    Saringei,
    I'm sure there is a better way to do this (maybe with
    actionscript), but you can acheieve this effect by putting each
    fade in/fade out in a separate layer. for example, have image1 fade
    in and out in layer 1 going from frame 1 to frame 10, then image2
    goes in layer 2 from frame 11 to frame 20, etc. Like I said, there
    is probably a better way that maybe someone else can suggest, but
    I'm pretty sure this will work.
    Bob

Maybe you are looking for

  • Form on SQL is not working

    Hello, I am trying to setup a form which will bring up data only relevant for the current user. For example, on one page I have a list of employees who report to a manager and I setup a link attribute on the employee name. When the manager user click

  • ICal event invitation failures due to missing/malformed email addresses

    These problems, although slightly different, appear in both 10.5.8 and 10.6.1. I don't see in the release notes that this was addressed in 10.6.2, but I have not installed it yet. In 10.5.8, sometimes when a user is invited through the iCal invitatio

  • Multiple profit centers for F.05

    Dear experts, The F.05 is used for post the revaluation for AP AR, and we have configed 3KEH to assigh profit center to revaluation account, but the user want the revaluation account have the same profit center with the reconciliation account which t

  • Please solve battery problem iOS 5.0.1 we are about to sell iPhone, iPad, iPod and replace them with others

    I have iPad, iPhone and iPod. I have updated all of them with iOS 5.0.1. After this wrong direction, all of them are facing a battery problem. Please solve solve solve it. This is a bad things from apple. We are about to stop trusting them. We have s

  • Uk dictionary not loaded

    On my new ideapad a series, the spell check is not working correctly. All words are marked as incorrect unless they have been added to the user dictionary. It seems that the uk system dictionary has not loaded. Can anybody suggest a fix?