AS3 Tween doesn't work proprly

Hi All,
I have a MovieClip with two buttons inside of it (bottom portion)
When I mouse over the MovieClip - it rises up, to revewl the buttons. My problem is, when I mouse over the buttons, the movie clip drops back down. The buttons don't have any actions upplied to them... It acts as though buttons were standing between the cursor and the movie clip...
The idea is to hower over the movie clip > reveal the buttons > either move mouse away or click on one of the buttons. However, the movie clip closes when I touch either one of the buttons.. Any help would be super appreciated! Below is the code and thnks a bunch ahead of time:
import fl.transitions.Tween;
import fl.transitions.easing.*;
var breatheOpenY:Tween;
var breatheCloseY:Tween;
breathe_mc.addEventListener(MouseEvent.MOUSE_OVER, breatheOpen);
breathe_mc.addEventListener(MouseEvent.MOUSE_OUT, breatheClose);
function breatheOpen(event:MouseEvent):void
    breatheOpenY = new Tween(breathe_mc,"y",None.easeNone,117,77,.5,true);
    breathe_mc.learn_btn.visible = true;
    breathe_mc.video_btn.visible = true;
function breatheClose(event:MouseEvent):void
    breatheCloseY = new Tween(breathe_mc,"y",None.easeNone,77,117,.5,true);
    breathe_mc.learn_btn.visible = false;
    breathe_mc.video_btn.visible = false;

Although I don't know what the problem was, I was able to fix it by using TweenLite instead of Flash native Tween Class;
import com.greensock.*;
import com.greensock.easing.*;
breathe_mc.addEventListener(MouseEvent.MOUSE_OVER, breatheOpen);
breathe_mc.addEventListener(MouseEvent.MOUSE_OUT, breatheClose);
function breatheOpen(event:MouseEvent):void
    TweenLite.to(breathe_mc, .5, {y:77});
    breathe_mc.learn_btn.visible = true;
    breathe_mc.video_btn.visible = true;
function breatheClose(event:MouseEvent):void
    TweenLite.to(breathe_mc, .5, {y:117});
    breathe_mc.learn_btn.visible = false;
    breathe_mc.video_btn.visible = false;
Thanks!!
Lana

Similar Messages

  • AS3 stop() doesn't work when saved to a USB drive

    Demonstarting basic AS3 to my Flash class tonight I discovered a strange anomoly. I created a scene with multiple frames and added a stop(); action on the first frame. Simple! But when i save the fla file to a USB drive and test the movie or even publish it to an exe, the stop command no longer functions. Save the fla to the hard drive and test/publish, it works fine. I tried this on multiple computers using CS4 with different USB drives and even different fla files created from scratch. The problem is consistent. gotoAndStop( ) also ceases functioning when the fla file is saved to the USB drive and then tested/published. Any ideas as to the difference? (BTW, I also tried to do it with AS2 and the stop() command functions correctly on both the USB and hard drive). Anybody else encounter this strange behavior?

    I confirm what dmennenoh says cause I also work on a network drive and never had problems compiling SWFs. However I tried to an external USB drive and in fact it seems that any AS3 code is simply not included in the file therefore it cannot work!
    Doesn't seem to be a security issue but some kind of bug from Adobe...
    Correction:
    Sorry, tested to USB drive with an "already faulty" file. It works fine either external USB drive or pen drive!
    Can it be OS related?! I'm using Flash CS4 on Vista.
    (note: The file I tested has external classes, imports some xml and images but has no play and stop actions)

  • Shape Tweening - simple tween doesn't work

    I'm thoroughly discouraged with Flash CS3 for the trouble I'm
    having with this simple shape tween. Please tell me it's my fault
    so that I can get this to work and not think that Flash is dumb.
    I'm going from a small circle with a 1 px stroke to a round
    cornered rectangle with the same stroke. It looked like it spun a
    little during the morph so I added shape hints. I tried a few
    different arrangements and none of them really worked. The most
    annoying thing is when it looks right no the FLA and then the
    export is working correctly - obviously some kind of program
    defect.
    Shape hints:
    - All four corners with A starting in the top left and
    continuing around counter clockwise.
    - All four sides with A starting on the left side and
    continuing around counter clockwise.
    - A on left side and B on right side.
    They all either still spun funny or completely disappeared
    during the morph.
    All the hints appeared green and yellow for all arrangements
    - no red hints.
    In the past I've arranged them in what I would think to be a
    random order with the hints appearing red and the dam thing would
    actually work.
    Just the fact that I have to screw around with shape hints
    for this simple tween is silly.
    Simple fix here?

    Thanks for reporting the issue. Please move the code in first
    frame to frame 2 as a workaround.

  • HELP! Uploading AS3 Game to server, no sound and Spacebar doesn´t work HELP!

    Hello, relatively new to AS3 and flash, this is the first time i am publishing anything. We are trying to upload our simple flashgame to our webserver, the game works perfectly fine locally save for one thing. We get an error regarding TLF which says it wont stream or something. So when it gets online, no sounds play and spacebar doesn't work, left and right arrow does work. We have three TLF text fields that are used to update score, lives and show you final score. If i turn these into classical text they stop working.
    Things we have tried: Changing default linkage from RLS to Merged into code, changing the text boxes to classical text(they then stop working), made sure the paths are correct(all files are in the same directory including the .swz file)
    This is the code from the soundclass:
    package 
        import flash.net.URLRequest;
        import flash.media.Sound;
        import flash.media.SoundChannel;
        import flash.events.*;
        public class MySound
            private var bgSound:Sound;
            private var fireSound:Sound;
            private var waterSound:Sound;
            private var earthSound:Sound;
            private var lightSound:Sound;
            private var soundChannel:SoundChannel;
            public function MySound()
                soundChannel = new SoundChannel();
                bgSound = new Sound();
                var req:URLRequest = new URLRequest("BackgroundSound.mp3");
                bgSound.load(req);
                //fire
                fireSound = new Sound();
                var req2:URLRequest = new URLRequest("soundFire.mp3");
                fireSound.load(req2);
                // water
                waterSound = new Sound();
                var req3:URLRequest = new URLRequest("soundWater.mp3");
                waterSound.load(req3);
                // earth
                earthSound = new Sound();
                var req4:URLRequest = new URLRequest("soundEarth.mp3");
                earthSound.load(req4);
                // light
                lightSound = new Sound();
                var req5:URLRequest = new URLRequest("soundLight.mp3");
                lightSound.load(req5);
            public function playBgSound()
                soundChannel = bgSound.play(0, 999999);
            public function stopBgSound()
                soundChannel.stop();
            public function playFireSound()
                fireSound.play();
            public function playWaterSound()
                waterSound.play();
            public function playEarthSound()
                earthSound.play();
            public function playLightSound()
                lightSound.play();
    I can somewhat get that sound can bugg out, but why does spacebar stop functioning? ANy help is greatly appreciated as this has to be delivered in twelve hours(published online) for a school assignment.

    Also might add publishing it locally in my own browser everything works, as does ofcourse playing it in flash itself. Changing from RLS to merged into code stops the error from coming, but doesn´t fix the problem on the server.
    Code from main class related to sound and spacebar:
    import flash.display.*;
        import flash.events.*;
        import flash.ui.Keyboard;
        import flash.text.TextField;
        import flash.media.Sound;
        import flash.net.URLRequest;
        import flash.events.MouseEvent;
        import flash.utils.Timer;
        import flash.events.TimerEvent;
        public class main extends MovieClip
            private var fireTimer:Timer; //delay between shots
            private var canFire:Boolean = true;
            private var mySound:MySound;
            private var bulletSpeed:Number = -450;
              public function main()
                //load sounds
                mySound = new MySound();
            private function playGame(event:MouseEvent)
                gotoAndStop(2);
                // initialize
                myLives = 5;
                myHitsNo = 0;
                weaponType = 1;
                mybullets = new Array();
                enemys = new Array();       
                myScoreTxt.text = "Score: " + myHitsNo;
                myLivesTxt.text = "Lives: " + myLives;   
                fireTimer = new Timer(400, 1);
                fireTimer.addEventListener(TimerEvent.TIMER, shootTimerHandler, false, 0, true);
                stage.addEventListener(KeyboardEvent.KEY_DOWN, listenKeyDown);
                stage.addEventListener(Event.ENTER_FRAME, addEnemy);
                stage.addEventListener(Event.ENTER_FRAME, checkCollision);   
                player = new thePlayer(stage.stageWidth-40, spawnPoint2);// stage.stageHeight/2);
                stage.focus = player;
                addChild(player);
                mySound.playBgSound();
    public function listenKeyDown(event:KeyboardEvent)  // Controls and weapontype selector
                if (event.keyCode == 37) //left
                    player.movethePlayerDown();
                if (event.keyCode == 39) //right
                    player.movethePlayerUp();
    if (event.keyCode == Keyboard.SPACE) //space
                    shootBullet();
                    //soundFX.attachSound("Pistol Fire.wav");
                    //soundFX.start();

  • My AS3 Quiz Widget doesn't work correctly

    First of all, yes I have set the project options to export as
    "AS3" and yes, the widget is also "AS3", so there should be no
    compatibility issues.
    I'm a flash programmer for 10 years now and this really
    brings me down to my knees whining and screaming...
    I programmed a very simple widget which displays a "Yes" and
    a "no" button instead of the radio-buttons you're forced to use
    otherwise for this type of question.
    I started with an AS3-Version which almost worked. The XML
    couldn't be received correctly and the result of hitting the right
    button didn't seem to have been recognized by the underlying
    Captivate movie.
    Then I converted it to AS2. (also setting project options to
    export as as2). Everything worked immediately as expected.
    Then I converted it BACK to AS3 to be sure to have the exact
    same program-logic and changed everything according to the AS3
    guidlines. Again, this didn't work.
    I suspect that the following functions aren't properly
    integrated in Captivate 4 yet:
    function answeredCorrectly(isSurvey:Boolean):Boolean
    This function never gets called from anywhere in the
    Captivate movie whenever I click on "send" or anything! But it
    really shoud be, because it's the only way to communicate the
    result to Captivate.
    var myXML:XML = new XML(movieHandle.widgetParams());
    This one doesn't get me the Parameter I was expecting. Even
    though the setInspector... and getInspector... functions work fine
    and I am able to set everything in the inspector window, this one
    always returns crap instead of the variables I set before using the
    inspector-functions.
    I included the whole code which doesn't work.
    On the stage is:
    btnJa => yes button
    btnNein => no button
    cbRightAnswer => pulldown for setting the right answer
    lblRightAnswer => label for pulldown
    dbg => debug window (because otherwise it would be a huge
    pain in the *** debugging this)
    So if anyone can spot the error, I'd be quite relieved,
    because this is driving me nuts.

    Yay, got it running!
    Sadly, the function that got it running was NOT included in
    the quiz-widget Template and I really wonder why, because this will
    cause some big frustrations among some users.
    I implemented the answers():Array function.
    And I wonder why the AS2-version did work flawlessly without
    it. And why it isn't included in the AS3 widget as-files. This
    could have saved me 3-4 hours of research.

  • Stop(); Action doesn't work in AS3?

    I'm a designer and usually work in AS2.
    But I created a movie in as3 (to use the Bones function), and now my stop actions are not working.
    What I usually do for my movies is break the movie down in parts on the Main timeline (Start/Content/End), place stops on each of these frames.
    And within the Movieclips that play on these labels I put a call:
    stop();
    _root.gotoAndPlay("Content") etc...
    Anyways any fixes for this in AS3?
    I'm using CS4 if that matters.

    The stop() command works as well in AS3 as it does in AS1/2.  What doesn't work is using AS2 terms like "_root".  In general, if a stop() command is not working it is because some other code is failing or otherwise overriding the stop().

  • AS3 tween not working in Cp5

    I have a mc named image_mc on the first frame of the file.
    on the first frame i also have:
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    import fl.transitions.*;
    var myTimer:Timer = new Timer(10, 1); // 1 second
    myTimer.addEventListener(TimerEvent.TIMER, zoomBack);
    myTimer.start();
    function zoomBack(e:Event) {
        var xscale:Tween = new Tween(image_mc, "scaleX", Bounce.easeOut, 1, .765, .5, true);
        var yscale:Tween = new Tween(image_mc, "scaleY", Bounce.easeOut, 1, .765, .5, true);
        //trace("back to 1st size");
    and  it still doesn't work right. when i test it within Cp5 (Live Preview)  and it works right so apparently it is still running when the entire  projects starts instead of waiting until the particular slide that it is  placed shows up. I don't know what is happening.

    Please take a look at this thread: http://forums.adobe.com/message/3606274#3606274

  • Movieclip(root) doesn't work inside a function

    Hey everyone,
    I'm having this problem.
    In fact, when i publish my FLA with player 9, there is no prob.
    When i publish with selecting player 10, there is this problem.
    I paste my code :
    var leng:int = MovieClip(root).program.websiteXML.pages.titlePage.length();
    trace ("leng"+leng);
    setInterval(function () : void {
              if (MovieClip(root).program.autoCh==true){
               trace("CHANGE");
              MovieClip(root).allContent.controllMenu2['itemButton_' + MovieClip(root).program.linkPic].gotoAndPlay("s4");
              if (MovieClip(root).program.linkPic < int(leng-1)){
                        MovieClip(root).program.linkPic++;
                           }else{
                               //MovieClip(root).allContent.play ();
                             MovieClip(root).program.autoCh=false;
                             MovieClip(root).program.linkPic=1;
                             MovieClip(root).allContent.controllMenu2['itemButton_' + MovieClip(root).program.linkPic].gotoAndPlay("s4");
                             for (var z:uint=1; z<(MovieClip(root).program.linkPic+1); z++) {
                                  var tempMC:MovieClip = MovieClip(MovieClip(root).allContent.controllMenu2)["itemButton_"+z];
                                  Tweener.addTween(tempMC, { x:(z-1)*(45+1)-353, time:1} );     
                             for (var j:uint=(MovieClip(root).program.linkPic+1); j<7; j++) {
                                  var tempMC2:MovieClip = MovieClip(MovieClip(root).allContent.controllMenu2)["itemButton_"+j];
                                  Tweener.addTween(tempMC2, { x:(j-1)*(45+1)+352, time:1} );     
                             MovieClip(root).allContent.controllMenu2['itemButton_' + MovieClip(root).program.linkPic].gotoAndPlay("s3");
                       }}, 4000);
    For leng variable, there is no problem, the value is taken.
    But it's inside SetIntervall, at
    MovieClip(root).program.autoCh
    it tells me that :
    TypeError: Error #1009: Il est impossible d'accéder à la propriété ou à la méthode d'une référence d'objet nul.
        at Function/<anonymous>()[main6_cs3_fla._00button_136::frame1:32]
        at Function/http://adobe.com/AS3/2006/builtin::apply()
        at SetIntervalTimer/onTimer()
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    And if I put the value outside the function :
    var autoChtest = MovieClip(root).program.autoCh;
    And use it :
    if (autoChtest==true)
    There is no errors but my function doesn't work correctly, as autoCh can be "false" in another action.
    Well, I hope this will not scare you, and someone will try to help me, please.
    If someone know anything about this issue or having same problem please tell me.
    Thanks!

    Ok i see more clearly, you know it's diificult for me to understand it because i'm into flash AS since a few weeks.
    And what you say about the way setInterval is use, with the function in it, i'm totally agree with that, it's difficult to read.
    The truth is that this is a template that I bought and it was like that, so to do what i've got to do i needed to change some AS3 code.
    This is how it is now :
    var rootvar = MovieClip(root).root;
    function diapodebut (e:TimerEvent) : void {
        if (rootvar.program.autoCh==true){
            trace("CHANGE");       
            rootvar.allContent.controllMenu2['itemButton_' + rootvar.program.linkPic].gotoAndPlay("s4");
            if (rootvar.program.linkPic < int(leng-1)){
                rootvar.program.linkPic++;
            }else{
                  //MovieClip(root).allContent.play ();
                rootvar.program.autoCh=false;
                rootvar.program.linkPic=1;
            rootvar.allContent.controllMenu2['itemButton_' + rootvar.program.linkPic].gotoAndPlay("s4");
            for (var $z:uint=1; $z<(rootvar.program.linkPic+1); $z++) {
                var tempMC:MovieClip = MovieClip(rootvar.allContent.controllMenu2)["itemButton_"+$z];
                Tweener.addTween(tempMC, { x:($z-1)*(45+1)-353, time:1} );   
            for (var j:uint=(rootvar.program.linkPic+1); j<7; j++) {
                var tempMC2:MovieClip = MovieClip(rootvar.allContent.controllMenu2)["itemButton_"+j];
                Tweener.addTween(tempMC2, { x:(j-1)*(45+1)+352, time:1} );   
            rootvar.allContent.controllMenu2['itemButton_' + rootvar.program.linkPic].gotoAndPlay("s3");
        else
            timerSynchro.stop( );
    var leng:int = MovieClip(root).program.websiteXML.pages.titlePage.length();
    trace ("leng"+leng);
    var timerSynchro:Timer = new Timer( 4000, 6) ;
    timerSynchro.addEventListener( TimerEvent.TIMER, diapodebut);
    timerSynchro.start() ;
    You can see that I use Timer class, i've seen on another website just what you say : use Timer instead of setInterval with AS3.
    If you still find something wrong to you, tell me!
    Thanks again for your help !

  • [AIR 3.0] New JSON functionality doesn't work in FlashPro: Error #1065: Variable JSON is not defined

    After upgrading the AIR SDK to 3.0 in Flash Professional CS5.5 I've found some problems.
    First, the JSON class in the as3corelib.swc library now throws a couple of compile errors:
    1061: Call to a possibly undefined method decode through a reference with static type Class.
    1172: Definition com.adobe.serialization.json:JSON could not be found.
    At first I was completely puzzled, since I had the proper "import com.adobe.serialization.json.JSON;" reference,
    and I had the "as3corelib.swc" referenced in my ActionScript Properties, so how could that not be found?
    Then, I found out that's because it conflicts with the new internal JSON class included with AIR 3.0
    (maybe it should have been called something else, to avoid conflicts with Adobe's own as3corelib library).
    The new native JSON class doesn't have the decode() method. Now it's called parse()
    Ok, so I've tried using the new JSON class, but after changing decode() with parse() and removing
    the "import com.adobe.serialization.json.JSON;" reference, Flash tells me that "Variable JSON is not defined".
    Really? The JSON class is showing in the Flash Builder code completion popup,
    complete with its all-new parse() and stringify() methods! So why does it say it's not defined?
    Also, my SWF file gets compiled with no errors at all, so that verifies that the new 3.0 libraries are in place.
    I only get the "JSON is not defined" error at runtime in ADL, not at compile time. Why?
    In order to upgrade to the AIR 3.0 SDK, I've followed this guide:
    http://kb2.adobe.com/cps/908/cpsid_90810.html
    I know that's about upgrading to AIR 2.7, but I suppose the steps to upgrade to AIR 3.0 would be very similar,
    only with the AIR3.0 SDK package, instead of 2.7.
    I also took care to type version="13" in all the XMLs, instead of version="12" as stated in that guide, which is meant for 2.7.
    Also, I followed this advice about adding -swf-version=13 in the Project Properties window in Flash Builder:
    http://blogs.adobe.com/cantrell/archives/2011/08/how-to-use-the-air-3-beta-sdk.html
    But that doesn't seem to make a difference, since, even though I use Flash Builder for code editing (which is usually used for Flex),
    my project is a Flash Professional project, not a Flex one, and when testing the project, Flash Builder runs Flash Professional
    to compile and then runs adl.exe (it's the same as if you click the option "Control / Test movie / in AIR Debug Launcher (Mobile)" inside Flash Pro).
    In the "ActionScript Settings" window in Flash Professional, I also have the proper airglobal.swc referenced (from the AIR 3.0 SDK),
    and the same airglobal.swc is referenced in Flash Builder as well (in "Referenced Libraries"), to get proper code completion.
    I've tried all sorts of things to try to get it to work, but no luck. Still get the "JSON is not defined" error at runtime.
    I'm starting to get desperate about this. I'm going to have to revert back to AIR 2.7.1, to stop wasting time on this issue.
    BTW, I'm also having another unrelated problem (though maybe it happens because of the same reason as the other problem).
    Now Flash Builder underlines the getTime() method in my code, as if it no longer were a method of a Date class instance.
    I have a line where I ask for the timestamp like this:
    ts = new Date().getTime();
    That has worked perfectly fine up until now with AIR 3.0.
    Now, when hovering the mouse cursor over the orange "(?)" icon that appears at the left, Flash Builder tells me
    "Access of undefined property getTime". Why?
    The AS3 documentation doesn't say anything about getTime() getting deprecated of anything of the sort:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Date.html
    In fact, in the code completion popup that Flash Builder shows, now there isn't any mention
    of get or set methods, as you can see here:
    I suppose I can use the .time property instead of .getTime() but I don't know why I'm not getting all the methods I had available before.
    Any ideas why all this is happenning? Specially the dreaded "JSON is not defined" error.

    Well, after much tinkering, I think I've finally found a way to finally make it work!.
    I've created some modified XML files with the profiles needed for AIR 3.0 and after a lot of tries, it finally works!
    I've uploaded them here: http://www.mediafire.com/?d5e761frl5px4
    These are the steps needed to get AIR 3.0 running properly:
    Put all three files into the folder "c:\Program Files (x86)\Adobe\Adobe Flash CS5.5\Common\Configuration\Players"
    Then, make sure you've unzipped the AIR 3.0 SDK into the folder "c:\Program Files (x86)\Adobe\Adobe Flash CS5.5\AIR3.0" Do not overwrite the contents of the "AIR2.6" folder, as suggested by the "Overlay AIR SDK" article (linked in the above post). It gave me problems. It's best to use a different separate folder. My XML files point to that new "AIR3.0" folder.
    Inside the folder "c:\Program Files (x86)\Adobe\Adobe Flash CS5.5\Common\Configuration\ActionScript 3.0" create a new folder named "AIR3.0". Inside that folder, copy the file "airglobal.swc" located at "c:\Program Files (x86)\Adobe\Adobe Flash CS5.5\AIR3.0\frameworks\libs\air".
    Finally, you will have to keep the file "descriptor-sample.xml" in the "c:\Program Files (x86)\Adobe\Adobe Flash CS5.5\AIR2.6\samples" folder, but change the xmlns attribute to "http://ns.adobe.com/air/application/3.0"
    Yes, you have to change that inside the AIR2.6 folder even if the SDK has been put into AIR3.0. That's because of how the publish settings work in Adobe Flash. It's hardcoded into a DLL, so that can't be changed. Not very intuitive.
    I think AIR SDK installations should be a lot more straightforward than this! I know Adobe AIR is meant for developers, not for final users, but still, all these not very well documented upgrade procedures are a pain in the ***. I've wasted A LOT of hours in this (more than half a day), with what should have been a straightforward upgrade!
    Adobe should make a SDK installer so we do not have to be tinkering with all these error-prone procedures each time a new update is released!
    Well, I hope those XML files are useful to somebody and avoids further frustration.
    Regards,
    OMA2k
    PD: BTW, I still have the .getTime() issue described in my above post, but it's not very important,
    since I can still use the .time property. Still, it puzzles me why this is happening.

  • My animation doesn't work in html page

    hi guys,i want you to help me , you know is so frustated to work for long being an animation and at the final doesn't work
    i've done an animation in flash using as3 code ,it's work perfetly.
    the problem is that when i insert it in my page nothing happens ,before to try with browser i test the swf with a play button in dreamweaver
    but nothing
    when i publized only the script is seen but the images not.
    i my server wamp on y computer under my folder for my website there is a folder named :images(for all images),on this folder i put the entire folder of my animation .
    but i don't know why it doesn't work
    i can say you all my animations with xml and AS3 in flash doesn't work in my page
    please give me a magic and quick solution
    thanks all of us for reading me
    my english isn't so much perfect
    bye

    thanks you for replying me
    but i solved it
    --- En date de : Lun 6.7.09, Nadia-P <[email protected]> a écrit :
    De: Nadia-P <[email protected]>
    Objet: My animation doesn't work in html page
    À: "augustine ngo ndjel" <[email protected]>
    Date: Lundi 6 Juillet 2009, 11h06
    It is very hard to help you without
    seeing your page... do you have the files uploaded to a
    server?  Can you post a link, so people can look at the
    code to see if they can find a solution for you.
    Nadia
    Adobe® Community Expert : Dreamweaver
    Unique CSS Templates |Tutorials |SEO Articles
    http://www.dreamweaverresources.com/
    http://csstemplates.com.au/

  • Link doesn't work in an external htmlText

    Hello!!!
    I am trying to fix this problem. My external text display fine and also the CSS. The problem is
    when I am using any tag in html like <a> doesn't work, doesn't try to open the link and also the mouse
    doesn't change to the default hand. I am attaching my code in AS3. If you see I am using a scroller
    and also a mask. Could you try to help me please?
    Thanks in advance!!!
    J
    var textLoader:URLLoader = new URLLoader();
    var textReq:URLRequest = new URLRequest("text/news.txt");
    var cssLoader:URLLoader = new URLLoader();
    var cssRequest:URLRequest = new URLRequest("styles/style.css");
    var style:StyleSheet = new StyleSheet();
    var scrollPercent:Number = 0;
    var minScroll:Number;
    var maxScroll:Number;
    var targetScroll:Number = text_mc.y;
    var easing:Number = 5;
    var scrollAmt:Number = 15;
    var scrollDirection:Number = 0;
    function textLoaded(event:Event):void
    cssLoader.load(cssRequest);
    cssLoader.addEventListener(Event.COMPLETE, cssLoaded);
    text_mc.external_txt.htmlText = textLoader.data;
    minScroll = text_mc.y;
    maxScroll = minScroll - text_mc.height + mask_mc.height;
    function cssLoaded(event:Event):void
    style.parseCSS(cssLoader.data);
    text_mc.external_txt.styleSheet = style;
    text_mc.external_txt.htmlText = textLoader.data;
    function dragScroller(event:MouseEvent):void
    var dragX:Number = line_mc.x - scroller_mc.width/2 + 1;
    var dragY:Number = line_mc.y;
    var dragW:Number = 0;
    var dragH:Number = line_mc.height - scroller_mc.height;
    scroller_mc.startDrag(false, new Rectangle(dragX,dragY,dragW,dragH));
    stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    stage.addEventListener(Event.ENTER_FRAME, setScrollPercent);
    stage.removeEventListener(Event.ENTER_FRAME, scrollText);
    function stopDragging(event:MouseEvent):void
    scroller_mc.stopDrag();
    function setScrollPercent(event:Event):void
    scrollPercent = (scroller_mc.y - line_mc.y) / (line_mc.height - scroller_mc.height);
    if(scrollPercent < 0)
    scrollPercent = 0;
    else if(scrollPercent > 1)
    scrollPercent = 1;
    targetScroll = (scrollPercent * (maxScroll - minScroll)) + minScroll;
    text_mc.y -= (text_mc.y - targetScroll) / easing;
    function scrollUp(event:MouseEvent):void
    setDirection(scrollAmt);
    function scrollDown(event:MouseEvent):void
    setDirection(-scrollAmt);
    function setDirection(dir:Number):void
    scrollDirection = dir;
    stage.addEventListener(Event.ENTER_FRAME, scrollText);
    stage.addEventListener(MouseEvent.MOUSE_UP, stopScrolling);
    stage.removeEventListener(Event.ENTER_FRAME, setScrollPercent);
    function scrollText(event:Event):void
    targetScroll += scrollDirection;
    text_mc.y -= (text_mc.y - targetScroll) / easing;
    if(text_mc.y > minScroll)
    text_mc.y = minScroll;
    targetScroll = minScroll;
    else if(text_mc.y <maxScroll)
    text_mc.y = maxScroll;
    targetScroll = maxScroll;
    scrollPercent = (text_mc.y - minScroll) / (maxScroll - minScroll);
    scroller_mc.y = (scrollPercent * (line_mc.height - scroller_mc.height)) +
    line_mc.y;
    function stopScrolling(event:MouseEvent):void
    scrollDirection = 0;
    textLoader.load(textReq);
    scroller_mc.buttonMode = true;
    text_mc.external_txt.autoSize = TextFieldAutoSize.LEFT;
    scroller_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragScroller);
    textLoader.addEventListener(Event.COMPLETE, textLoaded);
    up_btn.addEventListener(MouseEvent.MOUSE_DOWN, scrollUp);
    down_btn.addEventListener(MouseEvent.MOUSE_DOWN, scrollDown);

    Hi Kglad,
    I have this in news.txt:
    <span class="title">FUTURE ENGAGEMENTS</span>
    JUNE 2009
    Dates                 1,3,5,7,8,9
    Role                  Fenton (Cover)
    Event                Falstaff
    Company            <a href="http://www.yahoo.com">Glyndebourne Opera Festival </a>
    NOVEMBER 2009
    <span class="titles">Dates</span> 1,3,5,7,8,9
    <span class="titles">Role</span> Fenton (Cover)
    <span class="titles">Event</span> Falstaff
    <span class="titles">Company</span> Glyndebourne Opera Festival
    Thanks!!!
    J

  • Tween doesn't stop

    Hello
    My problem is that I have a movieclip that initiates a
    function when clicked. This function contains if-statements to find
    out if the movieclip has been pressed before. I then uses w.stop();
    to stop a tween started before, but i doesn't work!
    I want to stop the tween because otherwise the
    onMotionFinished-statements are executed and I don't want that
    until the tween really is finished. Can anyone help me?

    Seems to be working for me.
    The one thing I changed is that I wrapped the if else
    statements that check the width of box inside of an onEnterFrame
    function, that way the width of the box is checked continuously as
    the tween is running, and not just once when the function runs.
    Here's the code:

  • Flash CS5: Export SWC doesn't work

    Could anyone help me with this problem. I have Flash CS5 and I'm trying to export SWC from it to use as a library with Flex SDK (FlashDevelop). I have "Export SWC" checked in publish settings and for a while it worked. Now, even if it still is checked, SWC isn't created (at least in the same directory as SWF). I even tried creating a completely new FLA and copied everything from the old library in there. Still it doesn't work.

    I periodically run into this issue too. I tried various 'voodoo' practices like:
    removing old versions of the exported files first
    reverting to "Use Default Names" on the Formats tab
    adding HTML as a Type
    removing HTML as a Type
    un-checking "Include XMP metadata"
    But I still haven't found out what makes or breaks the magical SWC export...
    I'm using Flash CS5 Professional 11.0.2.489 on a PC
    Publishing as AS3, Player 10
    The .fla is quite large, 7,200 KB,
    The resulting .swf is 1,808 KB...
    still no swc...
    Anyone else have any tips on this issue?

  • Auto Stack with 0 secs doesn't work!

    When I put RAW and JPG together in one folder, I would like to stack them via "Auto Stack". Unfortunately the lag of "0 Secs" doesn't work. It should, because the pics have exactly the same shooting time.
    When I chose "1 sec" it works, but this stacks my shoot sequences together as well.

    Found this post when searching for an answer, but didn't find much elsewhere so I'll post my quick and ugly solution here. I'm sure it can be vastly improved, but I didn't have much more than 5 minutes. Note - setting .visible to false just ended up causing the autohide transition to occur over and over, so instead I'm just temporarily moving the whole sprite offscreen.
    (AS3, using CS5 component... note that 'player' is the FLVPlayback instance):
    //### force 'autohide' when mouse inactive
    var timer:Timer = new Timer(1500, 0);
    timer.addEventListener(TimerEvent.TIMER, onTimer);
    timer.start();
    var skinSprite:DisplayObject;
    var prevMouseX:Number;
    var prevMouseY:Number;
    function onTimer(e:TimerEvent):void {
      //get skinSprite if we haven't already
      if(!skinSprite) {
        var child:DisplayObject;
        for(var i:Number = 0; i < player.numChildren; i++) {
          child = player.getChildAt(i);
          if(i == 2) { //this is the skinSprite
            skinSprite = child;
      //check to see if mouse hasn't moved since last timer event
      if(skinSprite && mouseX == prevMouseX && mouseY == prevMouseY) {
        skinSprite.y = -1000;
      prevMouseX = mouseX;
      prevMouseY = mouseY;
    stage.addEventListener(MouseEvent.MOUSE_MOVE, stage_onMouseMove);
    function stage_onMouseMove(e:MouseEvent):void {
      if(skinSprite) {
        skinSprite.y = 0;

  • Loading XML generated by PHP doesn´t work

    I know what will you say: Search for a tutorial.
    Yes, i´ve searched here. Through internet. But i get no answer.
    I checked format. This is the xml output:
    <?xml version="1.0" ?>
    <root>
    <nivel nombre='A1'>
    <item>
    <nombre>audio1</nombre>
    <tipo>audio</tipo>
    <descargable>si</descargable>
    <url>../multimedia/Audios/A1_audio1.MP3</url>
    </item>
    </nivel>
    <nivel nombre='A2'>
    <item>
    <nombre>leccion1</nombre>
    <tipo>texto</tipo>
    <descargable>si</descargable><nivel nombre='B1'><item>
    <nombre>audio1</nombre>
    <tipo>audio</tipo>
    <descargable>si</descargable>
    <url>../multimedia/Audios/B1_audio1.MP3</url>
    </item>
    </nivel>
    </root>
    I think the format is perfect. I can read it on my Firefox as a perfect xml.
    Now. This is action script code:
                var loader:URLLoader = new URLLoader();
                loader.addEventListener(Event.COMPLETE, cargaXML);
                loader.load(new URLRequest("reproductor_generador_datos.php"));
    When loaded i do
    trace(e.target.data);
    To see the xml, but it´s php. It hasn´t generated it.
    I follow every tutorial. This is the way. Is there any other way to make it "EXECUTE" the php code?? it donesn´t seem to work.
    The same happens when i assign it to an XML in AS3. It doesn´t work.
    Please help me. It´s taking so many time.
    Thanks!!

    Thanks a lot for the help, guys.
    Well. I think i had problems trying to copy the xml here. That´s why it´s broken.... but i don´t find the problem, though, there...
    Let me post here another example on how is it now. It´s got the header, and the <?xml tag.
    <root>
    <item>
    <nivel>A1</nivel>
    <id>0</id>
    <nombre>audio1</nombre>
    <tipo>audio</tipo>
    <descargable>si</descargable>
    <url>../multimedia/Audios/A1_audio1.MP3</url>
    </item>
    <item>
    <nivel>A2</nivel>
    <id>1</id>
    <nombre>leccion1</nombre>
    <tipo>texto</tipo>
    <descargable>si</descargable>
    <url>../multimedia/Textos/A2_leccion1.pdf</url>
    </item>
    <item>
    <nivel>A2</nivel>
    <id>2</id>
    <nombre>leccion1</nombre>
    <tipo>texto</tipo>
    <descargable>no</descargable>
    <url>
    ../multimedia/Textos/no_descargable/A2_leccion1.pdf
    </url>
    </item>
    <item>
    <nivel>A2</nivel>
    <id>3</id>
    <nombre>audio1</nombre>
    <tipo>audio</tipo>
    <descargable>si</descargable>
    <url>../multimedia/Audios/A2_audio1.MP3</url>
    </item>
    <item>
    <nivel>A2</nivel>
    <id>4</id>
    <nombre>audio1</nombre>
    <tipo>audio</tipo>
    <descargable>no</descargable>
    <url>../multimedia/Audios/no_descargable/A2_audio1.MP3</url>
    </item>
    <item>
    <nivel>A3</nivel>
    <id>5</id>
    <nombre>esFolleto2009</nombre>
    <tipo>texto</tipo>
    <descargable>si</descargable>
    <url>../multimedia/Textos/A3_esFolleto2009-2010.pdf</url>
    </item>
    <item>
    <nivel>A3</nivel>
    <id>6</id>
    <nombre>leccion1</nombre>
    <tipo>texto</tipo>
    <descargable>no</descargable>
    <url>
    ../multimedia/Textos/no_descargable/A3_leccion1.pdf
    </url>
    </item>
    <item>
    <nivel>A3</nivel>
    <id>7</id>
    <nombre>Avicena</nombre>
    <tipo>video</tipo>
    <descargable>si</descargable>
    <url>../multimedia/Videos/A3_Avicena.flv</url>
    </item>
    <item>
    <nivel>B1</nivel>
    <id>8</id>
    <nombre>audio1</nombre>
    <tipo>audio</tipo>
    <descargable>si</descargable>
    <url>../multimedia/Audios/B1_audio1.MP3</url>
    </item>
    <item>
    <nivel>B1</nivel>
    <id>9</id>
    <nombre>audio1</nombre>
    <tipo>audio</tipo>
    <descargable>no</descargable>
    <url>../multimedia/Audios/no_descargable/B1_audio1.MP3</url>
    </item>
    </root>
    well. maybe i fixed it ... lol... but i think it won´t work.

Maybe you are looking for

  • Help me!!!! my itunes library and play list are disappearance!!! Please!! 50gb of music!!

    Help me!!!! my itunes library and play list are disappearance!!! Please!! 50gb of music!!

  • Start up disk memory full

    Hi, I was attempting to download a tv show from itunes and I couldn't. A prompt said I needed to empty the trash or delete items. I emptied the trash and tried again but it still wouldn't let me. What kind of items should I delete first? Which items

  • Pages won't open documents

    I just made about 15 documents that are cards printed on half sheets of photo paper. I print a photo on one half of the page and then fold it in two and have a beautiful thank you note to use. I made and printed many of them. I opened them again as d

  • Adjustment required due to modification.

    Hi, We are using Travel Management ERP6.0. SAP provides a screen 9999 (User Data screen) within the dialog program SAPMP56T for customers to store or display custom fields, but this is still considered a modification. We did utilize heavily on this U

  • IWeb suddenly won't publish

    All of a sudden, when I try to publish my site, .mac tells me to sign in. I type in my password, but nothing happens. Please help!