Yoyo in interpolation does not

Hello, I have a Tween in my .fla that does not work properly. I have 2 buttons, Start and Yoyo. When I click on the button 'Start' the Tween is running. The game of the button "Yoyo" by clicking on the interpolation in sense reverses. All very well, but when I press the 'Start' button again after that I ran the animation twice the animation still runs in yoyo mode. What is my problem. Code:


Import fl.transitions.Tween;

Import fl.transitions.TweenEvent;

Fl.transitions.easing import. *;


Interpolation settings

var myTween:Tween = new Tween (mybox_mc, "y", Back.easeInOut, 0, 100, 1, true);


Stop the interpolation

myTween.stop ();


Event listeners

start_btn.addEventListener (MouseEvent.CLICK, moveContHolder);

yoyo_btn.addEventListener (MouseEvent.CLICK, moveContHolderR);


Functions

function moveContHolder(e:MouseEvent):void {}

myTween.start ();

}


function moveContHolderR(e:MouseEvent):void {}

myTween.yoyo ();

}

It is obvious that the interpolation is redefined/overthrown by the yoyo() method, so if your goal is to have the tween object back, then you really need only yoyo() as interpolation method was started.  So what you can do is to redefine the start_btn feature when the user clicks on the yoyo_btn.

Import fl.transitions.Tween;
Import fl.transitions.TweenEvent;
Fl.transitions.easing import. *;

Interpolation settings

var myTween:Tween = new Tween (mybox_mc, "y", Back.easeInOut, 0, 100, 1, true);

Stop the interpolation

myTween.stop ();

Event listeners

start_btn.addEventListener (MouseEvent.CLICK, moveContHolder);
yoyo_btn.addEventListener (MouseEvent.CLICK, moveContHolderR);

var tweensStarted:Boolean = false;

Functions

function moveContHolder(e:MouseEvent):void {}
myTween.start ();
tweensStarted = true;
}

function moveContHolderR(e:MouseEvent):void {}
myTween.yoyo ();
{if (tweensStarted)}
start_btn. RemoveEventListener (MouseEvent.CLICK, moveContHolder);
start_btn.addEventListener (MouseEvent.CLICK, moveContHolderR);
tweensStarted = false;
}
}

Tags: Adobe Animate

Similar Questions

  • I want to slow down the pace. When I move the cursor at the end of the tween, to drag the end of the Tween to the right to lengthen the interpolations, the cursor does not change to a double-headed arrow, as it should to.

    Hello.

    I want to slow down the pace in an animation frame-to-frame hand drawn at 24 frames per second. When I move the cursor at the end of the Tween (24 images), in order to drag the end of the Tween to the right to lengthen the interpolations, the cursor does not a double arrow as it should, but changes to a black arrow with a small white rectangle with a border dotted, to the lower right of the cursor. Therefore, I can't extend the interpolations. Can anyone say about this?

    I am on the 20th day of a trial of Adobe Flash Professional CC, on an iMac osx 10.11.2 El Capitan. I use a Wacom pen.

    Thanks for any help. (I'm a complete newbie to the animation)

    Thanks for this very useful information and thanks to other members of the forum who also gave me great advice.

    I will experience more away, using the excellent information, I have now.

    Thank you all.

  • ListEvent.ITEM_CLICKED does not

    Hi all

    This is my first post so first off thanks to everyone in advance for their help! I am working on an application for the Playbook and things have been going very well. Unfortunately, I met an obstacle that I have been struggling with for the last few days. The problem I have is that her does not seem to be the ListEvent.ITEM_CLICKED event fires when the list is added to a sprite that is not the sprite of the main application. If I add the same list for the main sprite code everything works correctly. I've created a demo application to show what I'm doing and the result:

    ListTest.as - point of entry of the Application.

    package
    {
        import flash.display.Screen;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.MouseEvent;
    
        import caurina.transitions.Tweener;
    
        import qnx.ui.buttons.LabelButton;
        import qnx.ui.data.DataProvider;
        import qnx.ui.theme.ThemeGlobals;
    
        [SWF(width="1024", height="600", backgroundColor="#666666", frameRate="30")]
        public class ListTest extends Sprite
        {
            public var button:LabelButton;
            public var listScreen:Screen1;
    
            public function ListTest()
            {
                super();
                ThemeGlobals.currentTheme = ThemeGlobals.BLACK;
    
                button = new LabelButton();
                button.label = "Switch Screen";
                button.addEventListener(MouseEvent.CLICK, switchScreen);
    
                addChild(button);
    
                this.stage.nativeWindow.visible = true;
    
            }
    
            public function switchScreen(e:Event):void
            {
                listScreen = new Screen1();
                addChild(listScreen);
                Tweener.addTween(this, {x:0, y:-600, time:.3, transition:"linear"});
            }
        }
    }
    

    Screen1.as - the second Elf who comes alive in when you click on the button "Switch screen.

    package
    {
        import flash.display.Sprite;
    
        import qnx.ui.data.DataProvider;
        import qnx.ui.events.ListEvent;
        import qnx.ui.listClasses.List;
        import qnx.ui.listClasses.ListSelectionMode;
        import qnx.ui.theme.ThemeGlobals;
    
        public class Screen1 extends Sprite
        {
            public var testList:List;
            public var ar:Array = [ { label : 'bob', id:1234 }, { label : 'fred', id: 4567 } ];
    
            public function Screen1()
            {
                super();
                this.y = 600;
                ThemeGlobals.currentTheme = ThemeGlobals.BLACK;
    
                testList = new List();
                testList.width = 500;
                testList.height = 500;
                testList.x = 200;
                testList.selectionMode = ListSelectionMode.SINGLE;
                testList.dataProvider = new DataProvider(ar);
                testList.addEventListener(ListEvent.ITEM_CLICKED, onClick);
    
                addChild(testList);
            }
    
            public function onClick(e:ListEvent):void
            {
                trace("onClick called from ListeEvent.ITEM_CLICKED event");
            }
        }
    }
    

    If debug the application 'onClick' never fires. I hope that it is something simple but as I mentioned that this only happens with the list is a child of a Sprite that is not the sprite of the main application.

    Hey,.

    just an update to get the same effect you had initially without this "boring" workaround, I gave in my previous post, run the following code. This time the class Screen1 will this.y = 600, as you had originally. If this entire file remains the same. The only thing we ar change is the function switchScreen in your main application. Instead of the interpolation of the main application, we go to the just the Screen1 tween object.

    ListTest.as (changes in bold):

    package{   import flash.display.Screen;  import flash.display.Sprite;  import flash.events.Event;    import flash.events.MouseEvent;
    
      import caurina.transitions.Tweener;
    
      import qnx.ui.buttons.LabelButton;    import qnx.ui.data.DataProvider;  import qnx.ui.theme.ThemeGlobals;
    
      [SWF(width="1024", height="600", backgroundColor="#666666", frameRate="30")]  public class ListTest extends Sprite  {     public var button:LabelButton;        public var listScreen:Screen1;
    
          public function ListTest()        {         super();          ThemeGlobals.currentTheme = ThemeGlobals.BLACK;
    
              button = new LabelButton();           button.label = "Switch Screen";           button.addEventListener(MouseEvent.CLICK, switchScreen);
    
              addChild(button);
    
              this.stage.nativeWindow.visible = true;
    
          }
    
          public function switchScreen(e:Event):void        {         listScreen = new Screen1();           addChild(listScreen);         removeChild(button);          Tweener.addTween(listScreen, {x:0, y:0, time:.3, transition:"linear"});       }    }}
    

    Screen1.as (original):

    package
    {
        import flash.display.Sprite;
    
        import qnx.ui.data.DataProvider;
        import qnx.ui.events.ListEvent;
        import qnx.ui.listClasses.List;
        import qnx.ui.listClasses.ListSelectionMode;
        import qnx.ui.theme.ThemeGlobals;
    
        public class Screen1 extends Sprite
        {
            public var testList:List;
            public var ar:Array = [ { label : 'bob', id:1234 }, { label : 'fred', id: 4567 } ];
    
            public function Screen1()
            {
                super();
                this.y = 600;
                ThemeGlobals.currentTheme = ThemeGlobals.BLACK;
    
                testList = new List();
                testList.width = 500;
                testList.height = 500;
                testList.x = 200;
                testList.selectionMode = ListSelectionMode.SINGLE;
                testList.dataProvider = new DataProvider(ar);
                testList.addEventListener(ListEvent.ITEM_CLICKED, onClick);
    
                addChild(testList);
            }
    
            public function onClick(e:ListEvent):void
            {
                trace("onClick called from ListeEvent.ITEM_CLICKED event");
            }
        }
    }
    

    hope that helps even more. Good luck!

  • Exactly how AE does not distribute the images in the scenario of a composition of 29.97 FPS?

    This issue is out of curiosity. I always wondered how this works because from what I see, a composition with a framerate of 29.97 FPS will have just 30 frames per second for every second on the timeline. Will it ever really a second on the timeline with 29 pictures in to compensate for the gap of 0, 03-framework? If not, then how is the resolved variance? Is the way the calendar displays images not 100% about how reliable they are actually distributed through time? Looks like this will have to be a 'yes '. But then how not problems of this?

    For example, if you want to have something to display a timer that counted in seconds right , helps manufacturers of second on the timeline would be inaccurate? Even if there is a second image 29 somewhere on the timeline to compensate for the difference of 0, 03 - fps, there still are many executives who have proved align perfectly seconds entire on the timeline, but in reality they would line up with them. So I guess that follow-up question, I, it is the timeline a accurate watch accurate actually seconds or frames in 29.97 FPS scenario? According to my way of thinking, one of them can be quite correct, whereas it is? (After asking this, I thought about the time value to the output text and look to see what is displayed when the playback head is a brand of second whole.) It showed a whole, second value for all those that I checked, and so this means that the timeline is exact frames, not seconds)

    Let me explain. This is going a little long so let me first start by saying that no. frames are lost, mixed or deleted when you run at 29.97 FPS. The only thing that changes is how you count frames. This info will be part of a forthcoming White Paper on my new Web site.

    What color television came the engineers needed to add a few lines in the removal of a TV signal part to send the color information. It is called color burst. The number of new lines that they needed a pris.03 seconds to add to the signal. Since all countries that run 60 Hz electricity works at 60 Hz, and television at the time was intertwined with a pair of even and odd scan lines form a framework so rather than expedite the time it took to draw each scan line was decided to reduce the rate of 29.97 FPS to keep things running at an even multiple of 60 cycles. This would keep old black and white televisions works without problem. Change the time it took to paint a line of scanning would be lack of things for older sets. Country PAL found a better way to add color information using some existing lines which were not used for anything else so they eliminated the problem.

    What's meaning? They had to slow the pace because they needed to add a few lines to the color TV signal would know where they were supposed to show the program in color. The largest number of lines still had to adapt to 60 cycles, so if you have added several lines, you reading fewer frames per second.

    Now, here's the problem. How you count this odd number of images and make it work with a real-time clock. Fall time frame was the solution. Drop Frame timecode does not diminish the frames, it just is not all because when the standard broadcast half-hour is 28 minutes, nobody's going to care about a missing image number... NOTE: I did not lack a framework.

    I tell him again. NO frameworks are never fallen or crushed or shortened in any application that is used to change or manipulate the video. The only thing that happens is that some numbers of chassis jumped so the hours, minutes, and seconds displayed on the timer is always accurate.

    You can get funky what happens with individual images or fields when you put images of 24 frames per second of a film in a video sequence of 29.97 FPS - but they worked already. The same thing happens when you add pictures PAL to NTSC program. When images of 24 fps are put in a PAL 25 fps video format they just play back a little faster so they don't have to do a funny interpolation.

    We will return to the time display in your AE timeline when you have a 29.97 (or the standard fractional rates as 59.94 or 23.976) default display time should be Drop frame that removes picture numbers that it counts, but does not diminish the frames. With DFTC (indicated by the; between hours, minutes and seconds) is used when the chronology said 30 minutes, then it will take 30 minutes exactly for your video playback. You can check this for yourself by browsing through a timeline with a Drop Frame timecode display one image at a time. Select the window timecode and top to 10000 (1 minute no seconds without frames) you will find yourself 0; 00; 59; 28 step forward of an image to get to 0; 00; 59; 29; and then a framework more far and end up at 0. 01; 00; 02 no frames were dropped, only the chassis of 0 numbers; 01; 00; 00 and 0, 01; 00; 01. the time displayed is correct in the duration of an image, that doesn't make much difference when you deal with a minute, but it makes a huge difference if you're dealing with an hour.

    There is an option for the Non-goutte time frame, but both practices, it is useless because the Timekeeping in the timeline panel is always bad. More the program error. Fall time frame gives you the exact time with a maximum error of a frame and a half. In the one hour show, you're out of 4 seconds. It is not significant for a youtube video, but it would be disastrous for network programming.

    You can check it out yourself. Start a new comp and the duration 1 hour. Add a solid layer and then press o to move the out point and you will see that the timecode is 0, 59; 59; 29 images. Do not get confused here because he said not 1 hour. Don't forget that the last image needs to continue to play for the program to stop because the CTI stops on the last visible image. Now, hold down the Ctrl/Cmnd key and click on the time indicator in the timeline and you'll see 107891 frames. A word of caution, if you look at the display of the time code and that you change the layout or project of frame drip not part time you will change the length of the composition and the number of images.

    Now, go to the project settings in earlier versions or to the Composition settings in the latest versions and select Non Drop Frame timecode display. Check the chassis numbers - they are exactly the same. Now Ctrl/Cmnd click the time indicator again and you will see 0:59:56:11 - If you were creating an hour long program and that you had the timecode set to image not to drop your program you would like to add about 4 seconds to your program. Imagine your surprise when he played on television and the last 4 seconds was cut off.

  • Movement of keyframes does not - I can see the values change, but nothing happens in the monitor!

    I'm having a nightmare trying to program in a few Motion keyframes to change the position of an element in my program monitor.

    I created the image key to assign the value of the position of an element in the timeline - I want the clip to move toward the Center on the side of the screen. I followed the guidelines and can see the keyframe symbols appear in the view of key images marking the beginning and the end of the change. What is strange, is that when I press play, I can see values changing in the effect controls panel - but nothing really happens in the clip! The clip in question has a silhouette figure, that I created using images of the figure against a green screen, which has then been hidden. I then applied a track matte key to the below item to fill the silhouette with footage - this has something to do with my animation does not?

    I checked to assure that I do apply keyframes for the clip, checked parameters interpolation of keyframes of & all seems in order. I'm new to first, & I apologize if I've properly referenced the different tools or windows - but I hope you get the idea. I looked online but can't find someone reporting a similar issue, that is certainly a first when you are working with such a popular program. I hope that it is something stupid and can be easily solved.

    Can someone tell me why the keyframes, I could, & can change the clip plays, are not actually affecting the clip at all? Any help would be greatly appreciated.

    I realized after the announcement that if I applied the keyframe to the matte rather than the silhouette clip keyframes of the movement worked. Thanks for the advice so guys!

  • Photoshop "save under" does not not on dialogue Parallels

    I have Photoshop CS5 running on a MacBook OS 10.8 Parallels/Windows XP.  When I try to "save under", the dialog box does not come to the top.  I installed the latest update.  Other CS5 programs (for example, Dreamweaver and Fireworks) do not have this problem.  Also, when I try to do a 'Save for Web and Devices', the dialog box IS launched, but it is oversized for the window and cannot be resized to make accessible command buttons.

    Any suggestions would be welcome.

    Hi Noel!  Thanks for the suggestion.  I tried to play with the resolution of the window in the control panel.  This made a mess... but in the process, I discovered that if I run Photoshop in Coherence mode (i.e. not interpolated with Windows ' window'), the dialog box shows up.  So, your suggestion regarding the resolution of the window solves the problem.

    Thank you!

  • Motion tween does not - CS5

    I created a symbol, placed on the timeline, make a copy and moved to another location on the timeline, clicked in the middle and selected motion tween. It shows an interpolation of movement on my calendar, but when I move the playhead, there is no animation, just a start State and a final State. Help, please!

    should be a symbol on this layer, there should be no other object, be careful, a single point can do does not work

    If you copy the symbol of the time line can use 'create a classic Tween.

    to use "Create motion tween" just like to click on the image of the scenario (without copying anything in the timeline panel) and select "Create motion tween", position the playhead to the image you want and move the position of the symbol

  • position. Velocity does NOT

    Hello

    I wrote preset with expressions in AE cs4 and it was to calculate the direction of motion of the layer.

    It worked perfectly in CS4.

    In CS5 the resulting vector very often has a length of 0 - especially with the NULL values that have applied the tracking data.

    Even if the value Null'S move.

    A workaround solution I found was to use a BakeTransforms script on the Null layer.

    The movement does not change, but now for some reason any position.vector give an appropriate value.

    After that experiment, it seems that if a null gets applied data track, the position.velocity vector for the null value still isn't valid

    Any ideas?

    > It totally worked in CS4 so what gives?

    Really? For me, it's the same in CS4 and CS5.

    Another thing you can do is to change the spatial interpolation of the Bezier keyframes.

    Dan

  • Export Flash CS5 to Quicktime - why it does not work?

    I have a 2.93 Core 2 with 8 GB of RAM.

    I have a Flash video with text, graphics and animations. It's long 2 minutes. The SWF works fine. ActionScript 3.0. resolution 900 x 500.

    When I first attempted to export to quicktime, it gave a very close message that:

    «WARNING: Runtime Shared libraries (RSL) could not be associated with the file because of the publication settings Quicktime.»

    The wording may be a bit off, it's memory. Don't forget, that I'm not even publish at this point, I export. Not that I could make the difference.

    If, after the display of this message, the progress bar continues to fill up until it is completely filled, and then nothing happens. The juice bar is full, do nothing. For hours.

    So after that I've explored the parameters of publication, I found on the 'Flash' tab, a drop-down menu that allow me to choose "merge in code" as the integration of the Runtime Shared Library with the file. Then I hit publish. The progress bar fills up and disappears, press OK. Still, I can't find any movie file (or even the place where published GB of files) on my computer.

    After that, I try to export. The appeared before warning disappeared, but the progress bar always crashes when it is full, and no file is produced.

    One thing I thought is maybe it has to do with the number of images in my file. I inserted the action stop at the end, so the video stops and does not loop when previewing the SWF, however there are still many blank executives, which contain all objects or interpolations or something like that. The setting is currently 'stop encoding finally framework', which I guess means the last picture of my video before automatic shutdown. I can't find a way to make the empty frames after this point to disappear, I tell myself that it is part of the program itself.

    If anyone has other issues that will help in the face of this point, let me know.

    I searched these forums and is about 4 with the unanswered question, I can find no help anywhere else on the web either.

    If anyone knows of any other method to convert the SWF or FLA file about any other useful such as MPEG, AVI, etc., please let me know. I tried Media Encoder and After Effects, and none of them could help me to convert the file.


    Thanks in advance for any input about what you might have!

    Post edited by: elephantdesign

    When you select "when the last image is reached" for the option "Stop exporting", it will stop recording when the movie reaches the last frame of the movie. However, if you have "stop();" action in the context of the film, it stop the film, but continues to record the movie and the memory of your system runs. You can comment out the stop action or specify the duration of the recording control option "after a time' option 'stop export '. There is a tip on the optimization of the export of QuickTime in our site knowledge base: http://kb2.adobe.com/cps/401/kb401520.html. Thank you

  • If the declaration does not affect the for loop

    I wrote a function within a function to control 2 interpolations.

    (the 2nd is not in function, it is called)

    My problem is... is that it works for the first time... the button is hovered over, and all other buttons are and then disappear again, except the one you are. Then I do a 2nd time and it does not work. why it doesn't work just once? and why isn't the case stated, I put in the local function affecting the loop for? The 2nd time, it takes the button you're hovering above with her and she faints. (even if the if statement depending on the trace)

    This is the code

    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    
    var shortInst:Array = [btn1, btn2, btn3, exit];
    
    var objTween:Tween;
    
    function mouseOff(e:Event):void {
         if (e.currentTarget.alpha !== 0) {
              objTween = new Tween(e.currentTarget, "alpha", None.easeOut, 1, 0, 0.25, true);
         }
    }
    
    
    var eTimer:Timer = new Timer(3000, 1); //timer that only runs once (in ms)
    function navFX(e:Event):void {
         for (var i:Number = 0; i < shortInst.length; i++) {
              objTween = new Tween(shortInst[i], "alpha", None.easeOut, 0, 1, 0.25, true);
         }
              eTimer.addEventListener(TimerEvent.TIMER, local);
              eTimer.start();
              function local(t:TimerEvent):void {
                   trace("e.target in local func: " + e.target);
                   for (var i:Number = 0; i < shortInst.length; i++) {
                        if (shortInst[i] !== e.target) {
                        shortInst[i].dispatchEvent(new Event(MouseEvent.MOUSE_OUT));
                        }
                   }
              }
    }
    

    is that what you want?

    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;

    var shortInst:Array is [btn2, btn3, btn1, exit];.

    var objTween:Tween;

    function mouseOff(e:Event):void
    {
    If (e.currentTarget.alpha! == 0)
    {
    objTween = new Tween(e.currentTarget,"alpha",None.easeOut,1,0,0.25,true);
    }
    }

    function navFX(e:Event):void
    {
    var eTimer:Timer = new Timer (3000,1); //<- moved="" that="" line="">
    for (var i: Number = 0; i< shortinst.length;="">
    {
    objTween = new Tween(shortInst[i],"alpha",None.easeOut,0,1,0.25,true);
    }
    eTimer.addEventListener (TimerEvent.TIMER, local);
    eTimer.start ();
    function local(t:TimerEvent):void
    {
    trace ("e.target in local func:" + e.target);
    for (var i: Number = 0; i< shortinst.length;="">
    {
    If (shortInst [i]! = e.target)
    {
    shortInst [i] .dispatchEvent (Event (MouseEvent.MOUSE_OUT)) of new;
    }
    }
    }
    }
    for (var i: Number = 0; i< shortinst.length;="">
    {
    shortInst [i] .alpha = 0;
    shortInst [i] .addEventListener (MouseEvent.MOUSE_OVER, navFX);
    shortInst [i] .addEventListener (MouseEvent.MOUSE_OUT, mouseOff);
    }

  • SoundChannel event.sound_complete does not? Help?

    Hello

    For some reason, my soundchannel event.sound_complete does not work. In fact, my class is to import its in and to allow the use to change their volumes and sound technology.

    This is the tutorial for speed

    http://blog.Andre-Michelle.com/2009/pitch-MP3/

    Right now, what I want to do is to auto loop back the song once the song ended the game, but I saw troubled do. No matter which, can help me?

    The code will pass by the SoundForward() function

    Inside, it will trigger _mp3.addEventListener (Event.COMPLETE, complete);

    and the activity function Rollback() will.

    Inside, it will trigger a _soundChannel.addEventListener (Event.SOUND_COMPLETE, loopMusic);

    but then the function fires once the song ended he played.

    Benson

    Thank you

    ------------------------------------------------------------------------------------------ -----

    {package examples

    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.SampleDataEvent;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.net.URLRequest;
    import flash.utils.ByteArray;

    SerializableAttribute public class SoundForward extends Sprite
    {
    private const blockSize:int = 3072;

    private var _mp3:Sound;
    private var _sound:Sound;
    private var _soundChannel:SoundChannel;

    private var _target:ByteArray;
    private var _position:Number;
    private var _rate:Number;
    private var _stop:Boolean;


    private var _pausePoint:Number;

    public void SoundForward (url: String, stop: Boolean)
    {
    _target = new ByteArray();

    _mp3 = new Sound();
    _mp3.addEventListener (Event.COMPLETE, complete);
    _mp3. Load (new URLRequest (url));

    _stop = stop;

    _pausePoint = 0;
    _position = 0.0;
    _rate = 1.0;

    _sound = new Sound();
    _sound.addEventListener (SampleDataEvent.SAMPLE_DATA, sampleData);

    _soundChannel = new SoundChannel();

    }

    private void complete(event:Event):void
    {
    _soundChannel = _sound.play ();
    _soundChannel.addEventListener (Event.SOUND_COMPLETE, loopMusic);
    }

    private void sampleData(event:SampleDataEvent):void
    {
    Reuse instead of leisure
    _target.position = 0;

    Shortcut
    var data: ByteArray = event.data;
    var scaledBlockSize:Number = blockSize * _rate;
    var positionInt:int = _position;
    var alpha: Number = _position - positionInt;

    var positionTargetNum:Number = alpha;
    var positionTargetInt:int = - 1;

    need var: int = Math.ceil (scaledBlockSize) + 2;
    var read: int = _mp3.extract (_target, need, positionInt);

    var n: int = read is need? blockSize: read / _rate;

    var l0:Number;
    var r0:Number;
    var l1:Number;
    var r1:Number;

    for (var i: int = 0; i < n; ++ i)
    {
    If (int (positionTargetNum)! = positionTargetInt)
    {
    positionTargetInt = positionTargetNum;

    Reading objective FIXED position
    _target.position = positionTargetInt < < 3.

    Read Stero two samples for linear INTERPOLATION
    L0 = _target.readFloat ();
    R0 = _target.readFloat ();

    L1 = _target.readFloat ();
    R1 = _target.readFloat ();
    }

    Write amplitudes interpolated streaming
    data.writeFloat (l0 + alpha * (l1 - l0));
    data.writeFloat (r0 + alpha * (r1 - r0));

    Increase the position of the target
    positionTargetNum += _rate;

    FRACTION OF THE INCREASE AND THE CLAMP BETWEEN 0 AND 1
    += Alpha _rate;
    While (alpha > = 1.0)-alpha;
    }

    -FILL the REST OF THE flow of DATA WITH zeros
    If (I < blockSize)
    {
    While (I < blockSize)
    {
    data.writeFloat (0,0);
    data.writeFloat (0,0);

    ++ i ;
    }
    }

    -INCREASE SOUND POST
    _position += scaledBlockSize;
    }

    private void loopMusic(e:Event):void
    {
    trace ("AB");
    }

    }
    }

    Use the code that I have suggested.  You should have only one sound (_mp3) instance in your code.

  • Form does not work when it s poses in a movieclip


    I've isolated the problem and it s seems to be concentrated in the path "mcForm.skickat eq 'Yes' below: (the serverside script is done in Php).

    I t looks like that the form does not work when it s respondent in a movie clip called mcForm with a button send simply called 'send '.
    I have to place the form in a movieclip, because the shape is a good interpolation made by Laco interpolation method.

    Everything works fine if ["BOLD"] I have no place [/ bold] form in a movieclip.

    Here´s a part of the actionscript in the script main navigation.swf:

    If (mcForm.skickat eq 'Yes') {}
    gotoAndStop ("labelFinished");
    }

    Here´s actionscript code on the button 'Send' in mcForm in navigation.swf:
    on (release) {}
    loadVariables (" http://www.homesit.se/phpmail.php", "", "GET");
    _parent. Play (); This statement is not the problem.
    }

    The chronology in navigations.swf never reaches the label "finished."

    It works fine if I do not place shape to a movieclip in navigation.swf timeline:

    If (mcForm.skickat eq 'Yes') {//this path is the problem
    gotoAndStop ("labelFinished");
    }

    Here´s in php serverscript:
    (I have no problem here)

    <?
    $headline = "mail from your Homesite.
    $text = "$name sent email you from your homesite.
    It wrote:

    $message
    ";
    mail ($mymail, $headline, $text,
    "To: $email. (' \nReply-to:".$email);
    ECHO ("Send = Yes");
    ? >

    What could possible be wrong

    I appreciate every response.


    The root of the problem (look at the code you posted), it's that there is no event that determines what should happen when your data comes back from PHP. When you use loadvariables, you need an event for mcForm, like our:

    {mcForm.onData = function ()}
    do something
    }

    The problem according to what I see is that on your main timeline code checks the value of mcForm.skickat, but you do not seem to define this variable anywhere. The php script returns a variable named 'send', but I do not see anywhere skickat. If it is not set, its value will be always "not defined".

    To make things more efficient, you should really use loadVars and a reponsed instead of loadVariables Manager. When you use loadVariables, all variables in the clip are sent to your php script that transfer really just data loss. Using loadVars, you specify what vars to send, making the process more efficient. See the docs... everything is in there (with examples).

    BTW... This is the Flash Media Server forum. In the future, you might want to ask questions like this in the general flash or actionscript forum, you will get more answers (more people read on these forums)

  • 2nd tween does not

    Can someone explain why the following interpolation in the main timeline Frame2 does not work? The 1st works very well.

    Frame1
    var twMoveClip:Object = new Tween (this.mcMenu.mcB, "FLF", Strong.easeInOut, 0, 196, 20, false ");
    twMoveClip.onMotionFinished = function (): Void {trace ("finished"); delete twMoveClip ;}}

    Frame2
    var nY:Number = this.mcMenu.mcB._y;
    var twMoveClip:Object = new Tween (this.mcMenu.mcB, "FLF", Strong.easeInOut, 0, 196, 20, false ");

    As kglad suggested, you could put your statements to import on other frameworks or you could re - write the code to look like this:

    This defines a function that you can call with various parameters allowing you have to press on the first image import declarations.

    Tim

  • Tween does not

    Edit - I realized that I do not show an essential part of my code...

    Import mx.transitions.Tween;

    what I am doing wrong? the "dynaText" clip is attached, he gets the string inserted in it, but it is not melted as I want using the Tween class.

    Furthermore, although the script does not get that until now, the next part below it looks it will not work either. I would expect onMotionFinished to change color in my actionscript Editor, since he is an identifier... but it doesn't. I do the first part of work to see if the yoyo function will work, but it doesn't look like it will be.

    can somebody square this away for me?


    Try to use an embedded font.

  • Dynamic text - tween _alpha does not

    Hi again,

    Earlier, I asked for help on text dynamic interpolation. I have to move, now I just need to fade.

    Moving using "_x" works very well. With the help of "_alpha" does not at all.

    Here is the AS2:

    effect of interpolation to headline
    headline_txt._alpha = 0;
    var H1:Tween = new Tween (headline_txt, "_alpha", None.easeNone, 0, 100, 2, true ");
    headline_txt. Text = title [p];

    effect of interpolation on bullet1
    bullet1_txt. AutoSize = 'left ';
    var X 1: Tween = new Tween (bullet1_txt, "_x", Strong.easeOut, 0, 20, 1, true);
    bullet1_txt. Text = bullet1 [p];

    The effect of the interpolation on bullet1 works, is not the effect on the title. I'm at my wits end. It wasn't a long trip.

    Can anyone offer insight?

    Matt

    And once again, nevermind. Discovered that I needed to incorporate the police. Thank you!

Maybe you are looking for