Animating a button with actionScript

I'm fairly stumped on this one - but probably quite simple to fix.
I need to animate the scale of a button with actionScript 2.0. I've inherited a project that was done with actionScript 2.0 and have decided to stay with this generation rather than rewrite the whole project. Anyway - I've created a sound object, it plays audio from the library and 3 seconds after it starts playing, I want to animate the "next" button and make it pulse to attract the users attention.
Doing this by putting the button in a movie clip is not working as I am losing it's button states and besides it's probably far more tighter to program it.
When the user rolls over the button it stops pulsing but still retains it's up, over and down states.
Any easy answer?

Thanks for your help Ned.
I ended up making an advanced button with movie clips and using programming for all the states.
Movies are so much easier to control than buttons.
But you have raised something I had overlooked...setTimeout( )
I was using setInterval( ) and then doing clearInterval( ) within the function so it would only loop once, which of course was problematic if the user beat the 'clearInterval' code by clicking on the button too early.
Actually used setInterval( ) to delay all sound on the project - now going to re-program all that.
Thanks

Similar Messages

  • Need help with Buttons with ActionScript

    I am trying to create a button that will go to a different
    scene in my flash project using
    on (press) { gotoAndPlay(about,1);
    I have done this several times before, however, for some
    reason every time I try to put actions on my buttons it says that
    actions can't be applied to it. I have even tried switching them to
    movie clips. I can't figure out what is wrong.
    Any help would be greatly appreciated!
    Thanks

    Thanks for you help!!!! That worked!

  • Timeline Animation and interaction with ActionScript

    A simple timeline animation, runs fine but stops suddenly onRollOver action.
    car.onRollOver = function():Void {
         this._width -= 5;
         this._height -= 5;

    I could duplicate what you describe and cannot explain why it stops entirely, but it does.  If you follow the approach I described where the animation is separate from the code, it can do what you seem to want.
    Maybe someone else can explain what gets broken when you take your approach.

  • Hyperlink buttons with click-animation

    Hi there!
    Is there a way to create buttons with "click-animations". I use images as buttons, which have transparent hyperlinks above so when the user taps on it he gets to next page or wherever.
    Unfortunately, this solution is not very nice if there isn´t any feedback from the button...
    I hope someone has a solution.

    Hello again - I've a solution.
    The Pop-Over widget has exactly the kind of bottonfeedback I´m looking for so I tried to take advantage of this.
    This is what I did:
    1.     First I used the Pop-Over widget as usual, with the image of the button I want.
    2.     Then I put the hyperlink on top of it and change the hyperlink opacity to 0%.
    3.     The scrolling region of the Pop-Over widget remains empty.
    4.     Now I set the opacity of the scrolling region to 0%.
    If I tap the Button now on the iPad I get to the desired page AND there is the wonderful tapping feedback from the button caused by the Pop-Over widget.
    5.     The final little Problem to solve: The Pop-Over widgets scrolling region is highlighted with a shadow, wich is just visible if you tap the widget. If the opacity of the scrolling region is set to 0% the shadow unfortunately remains visible. You can´t see it here in the picture - it´s only if you tap the button.
    But as you can see - there is an option to turn off this shadow and it is disabled. I tried for hours but I didn´t find any possibility to enable the option that disables the shadow.
    At the moment it disturbs only a little, because I get linked quickly to another page. Further you almost don´t see the shadow if the background is dark but you see it if there´s a bright background. But in an eBook you perhaps pay for, nobody wants to see a shadowbug.
    So, anybody has an idea now how to disable the shadow of the Pop-Over widgets srolling region?

  • Stop and Play All Child MovieClips in Flash with Actionscript 3.0

    I am stuck with the ActionScript here. I have a very complex animated flash movie for eLearning. These contain around 10 to 15 frames. In each frame I am having multiple movie clip symbols. The animation has been created using a blend of scripting and also normal flash animation.
    Now I want to create pause and play functionality for the entire movie. I was able to create the pause function but when i try to play the movie it behaves very strange.
    I was able to develop the pause functionality by refering to the below mentioned links:
    http://www.unfocus.com/2009/12/07/stop-all-child-movieclips-in-flash-with-actionscript-3-0 /
    http://www.curiousfind.com/blog/174
    Any help in this regard is highly appreciated as i am approaching a deadline.
    I am pasting the code below:
    import flash.display.MovieClip;
    import flash.display.DisplayObjectContainer;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    import fl.transitions.*;
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    import fl.transitions.TweenEvent;
    import flash.events.Event;
    import flash.events.MouseEvent;
    stop();
    // function to stop all movieclips
    function stopAll(content:DisplayObjectContainer):void
        if (content is MovieClip)
            (content as MovieClip).stop();
        if (content.numChildren)
            var child:DisplayObjectContainer;
            for (var i:int, n:int = content.numChildren; i < n; ++i)
                if (content.getChildAt(i) is DisplayObjectContainer)
                    child = content.getChildAt(i) as DisplayObjectContainer;
                    if (child.numChildren)
                        stopAll(child);
                    else if (child is MovieClip)
                        (child as MovieClip).stop();
    // function to play all movieclips
    function playAll(content:DisplayObjectContainer):void
        if (content is MovieClip)
            var movieClip:MovieClip = content as MovieClip;
            if (movieClip.currentFrame < movieClip.totalFrames) // if the main timeline has reached the end, don't play it
       movieClip.gotoAndPlay(currentFrame);
        if (content.numChildren)
            var child:DisplayObjectContainer;
            var n:int = content.numChildren;
            for (var i:int = 0; i < n; i++)
                if (content.getChildAt(i) is DisplayObjectContainer)
                    child = content.getChildAt(i) as DisplayObjectContainer;
                    if (child.numChildren)
                        playAll(child);
                    else if (child is MovieClip)
                        var childMovieClip:MovieClip = child as MovieClip;
                        if (childMovieClip.currentFrame < childMovieClip.totalFrames)
          //childMovieClip.play();
          childMovieClip.play();
    function resetMovieClip(movieClip:MovieClip):MovieClip
        var sourceClass:Class = movieClip.constructor;
        var resetMovieClip:MovieClip = new sourceClass();
        return resetMovieClip;
    pauseBtn.addEventListener(MouseEvent.CLICK, onClickStop_1);
    function onClickStop_1(evt:MouseEvent):void
    MovieClip(root).stopAll(this);
    myTimer.stop();
    playBtn.addEventListener(MouseEvent.CLICK, onClickPlay_1);
    function onClickPlay_1(evt:MouseEvent):void
    MovieClip(root).playAll(this);
    myTimer.start();
    Other code which helps in animating the movie and other functionalities are as pasted below:
    stage.addEventListener(Event.RESIZE, mascot);
    function mascot():void {
    // Defining variables
    var mc1:MovieClip = this.mascotAni;
    var sw:Number = stage.stageWidth;
    var sh:Number = stage.stageHeight;
    // resizing movieclip
    mc1.width = sw/3;
    mc1.height = sh/3;
    // positioning mc
    mc1.x = (stage.stageWidth/2)-(mc1.width/2);
    mc1.y = (stage.stageHeight/2)-(mc1.height/2);
    // keeps the mc1 proportional
    mc1.scaleX <= mc1.scaleY ? (mc1.scaleX = mc1.scaleY) : (mc1.scaleY = mc1.scaleX);
    stage.removeEventListener(Event.RESIZE, mascot);
    mascot();
    this.mascotAni.y = 100;
    function mascotReset():void
    // Defining variables
    var mc1:MovieClip = this.mascotAni;
    stage.removeEventListener(Event.RESIZE, mascot);
    mc1.width = 113.45;
    mc1.height = 153.85;
    mc1.x = (stage.stageWidth/2)-(mc1.width/2);
    mc1.y = (stage.stageHeight/2)-(mc1.height/2);
    // keeps the mc1 proportional
    mc1.scaleX <= mc1.scaleY ? (mc1.scaleX = mc1.scaleY) : (mc1.scaleY = mc1.scaleX);
    var interval:int;
    var myTimer:Timer;
    // function to pause timeline
    function pauseClips(secs:int, myClip:MovieClip):void
    interval = secs;
    myTimer = new Timer(interval*1000,0);
    myTimer.addEventListener(TimerEvent.TIMER, goNextFrm);
    myTimer.start();
    function goNextFrm(evt:TimerEvent):void
      myTimer.reset();
      myClip.nextFrame();
      myTimer.removeEventListener(TimerEvent.TIMER, goNextFrm);
    // function to pause timeline on a particular label
    function pauseClipsLabel(secs:int, myClip:MovieClip, myLabel:String):void
    interval = secs;
    myTimer = new Timer(interval*1000,0);
    myTimer.addEventListener(TimerEvent.TIMER, goNextFrm);
    myTimer.start();
    function goNextFrm(evt:TimerEvent):void
      myClip.gotoAndStop(myLabel);
      myTimer.removeEventListener(TimerEvent.TIMER, goNextFrm);
    MovieClip(root).pauseClips(4.5, this);
    // function to fade clips
    function fadeClips(target_mc:MovieClip, next_mc:MovieClip, from:Number, to:Number):void
    var fadeTW:Tween = new Tween(target_mc, "alpha", Strong.easeInOut, from, to, 0.5, true);
    fadeTW.addEventListener(TweenEvent.MOTION_FINISH, fadeFinish);
    function fadeFinish(evt:TweenEvent):void
      next_mc.nextFrame();
      fadeTW.removeEventListener(TweenEvent.MOTION_FINISH, fadeFinish);
    // function to fade clips with speed
    function fadeClipsSpeed(target_mc:MovieClip, next_mc:MovieClip, from:Number, to:Number, speed:int):void
    var fadeTW:Tween = new Tween(target_mc, "alpha", Strong.easeInOut, from, to, speed, true);
    fadeTW.addEventListener(TweenEvent.MOTION_FINISH, fadeFinish);
    function fadeFinish(evt:TweenEvent):void
      next_mc.nextFrame();
      fadeTW.removeEventListener(TweenEvent.MOTION_FINISH, fadeFinish);
    // function to show screen transitions
    function screenFx(target_mc:MovieClip, next_mc:MovieClip):void
    //var tweenTW:Tween = new Tween(target_mc,"alpha",Strong.easeInOut,0,1,1.2,true);
    var tranFx:TransitionManager = new TransitionManager(target_mc);
    tranFx.startTransition({type:Iris, direction:Transition.OUT, duration:1.2, easing:Strong.easeOut, startPoint:5, shape:Iris.CIRCLE});
    tranFx.addEventListener("allTransitionsOutDone",doneTrans);
    function doneTrans(evt:Event):void
      next_mc.nextFrame();
      tranFx.removeEventListener("allTransitionsOutDone",doneTrans);
    // function to show screen transitions inverse
    function screenFxInv(target_mc:MovieClip, next_mc:MovieClip):void
    var tweenTW:Tween = new Tween(target_mc,"alpha",Strong.easeInOut,0,1,1.2,true);
    var tranFx:TransitionManager = new TransitionManager(target_mc);
    tranFx.startTransition({type:Iris, direction:Transition.IN, duration:2, easing:Strong.easeOut, startPoint:5, shape:Iris.SQUARE});
    tranFx.addEventListener("allTransitionsInDone",doneTrans);
    function doneTrans(evt:Event):void
      next_mc.nextFrame();
      tranFx.removeEventListener("allTransitionsInDone",doneTrans);
    // function to zoom in
    function zoomFx(target_mc:MovieClip):void
    //var tweenTW:Tween = new Tween(target_mc,"alpha",Strong.easeInOut,0,1,1.2,true);
    var tranFx:TransitionManager = new TransitionManager(target_mc);
    tranFx.startTransition({type:Zoom, direction:Transition.IN, duration:3, easing:Strong.easeOut});
    //tranFx.addEventListener("allTransitionsInDone",doneTrans);
    /*function doneTrans(evt:Event):void
      next_mc.nextFrame();
    // Blinds Fx
    function wipeFx(target_mc:MovieClip):void
    var tranFx:TransitionManager = new TransitionManager(target_mc);
    tranFx.startTransition({type:Wipe, direction:Transition.IN, duration:3, easing:Strong.easeOut, startPoint:9});
    // Blinds Fx Center
    function fadePixelFx(target_mc:MovieClip):void
    var tranFx:TransitionManager = new TransitionManager(target_mc);
    tranFx.startTransition({type:Fade, direction:Transition.IN, duration:1, easing:Strong.easeOut});
    tranFx.startTransition({type:PixelDissolve, direction:Transition.IN, duration:1, easing:Strong.easeOut, xSections:100, ySections:100});

    This movie is an animated movie from the start to end. I mean to say that though it stops at certain keyframes in the timeline it stops for only a certain time and then moves on to the next animation sequence.
    Its not an application where the user can interact.
    On clicking the play button i want the movie to play normally as it was playing before. If the user has not clicked on the pause button it would anyhow play from start to finish.
    Is there anyway where i could send in the fla file?

  • Can't access object using "id" or "name" if created with actionscript

    How can you register an instance of an object with actionscript so that it's id or name value is accessible?
    I included a simple example where a Button is created using mxml and in the same way it is created using actionscript.  The actionscript object is inaccessible using it's "id" and "name" property.
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                   creationComplete="application1_creationCompleteHandler(event)">
        <fx:Script>
            <![CDATA[
                import mx.events.FlexEvent;
                protected function application1_creationCompleteHandler(event:FlexEvent):void
                    import spark.components.Button;
                    var asBtn:Button = new Button();
                    asBtn.label = "actionscript";
                    asBtn.x = 200;
                    asBtn.id = "asButton";
                    asBtn.name = "asButtonName";
                    addElement(asBtn);
                    trace("mxmlButton="+this["mxmlButton"].label); // returns: mxml  label
                    //trace("mxmlButton="+this["asButton"].label); // returns runtime error: ReferenceError: Error #1069: Property asButton not found on TestId and there is no default value.
                    //trace("mxmlButton="+this["asButtonName"].label); // returns runtime error: ReferenceError: Error #1069: Property asButtonName not found on TestId and there is no default value.
            ]]>
        </fx:Script>
        <s:Button
            id="mxmlButton"
            label="mxml label"
            alpha="0.8"/>
    </s:Application>

    Hi Dan,
    It is a very rare occurrence when I miss not being able to access an object (object property, really) using the ["name"] notation for objects created using actionscript.
    In MXML the compiler is conveniently adding an attribute to the class with the same name as the id, so you can conveniently refer to it using the [] notation. While we explicitly specify an application container to use, the MXML compiler creates a custom container which is a derivative of the base container and to that it adds properties for the children declared in MXML. I guess it also effectively calls "addElement" for us when  the container is being constructed.
    Your example assumes that using "addElement" to add the button to the application container is the same as declaring a variable (ie property ). It isn't, so there's no point in looking for an property of the name "as3Button" using the [] notation, because it doesn't exist. The container is managing a collection of children in it's display list and that's not the same as being accessible as properties of the container.
    Generally speaking, accessing properties using the ["name"] syntax isn't necessary.
    Paul
    [edit: you may wonder why "addElement" doesn't conveniently also add the "id" attribute to be an property of the container class. Unfortunately, it can't because the container class would need to be dynamic and it's not. A further complication would be that adding properties at runtime would invite naming clashes at runtime with associated mayhem. MXML can do this because the compiler generates the class and can trap name duplication at compile time.
    Great question, BTW.
    -last edit changed my "attributes" to be "properties" in line with Adobe's terminology]

  • Is there a way to open a local file not a web file with actionscript 3.0?

    Reason for asking is because I am making a media player in Adobe Flash CS6, and was wondering if there was anyway to make a button to open a local .fla file in a directory with ActionScript 3.0 or if there are any other ways I can achieve this?
    Thanks Casey

    with an air app, check the file class.  otherwise, check the filereference class.

  • SWF movie export on frame-by-frame basis WITH actionscript

    Hi there,
    I know they're two ways of exporting flash movies:
    Export the whole timeline. This only allows timeline animations and gets messy because you have to cram up everything on the main timeline.
    Realtime-Export via Quicktime. This is a "full blown" export, but heavily dependent on CPU power or speed of harddrive, depending on resolution.
    I also work a lot with music programs and there is an option called "mixdown". This will render the whole song - as fast as the processor is capable - to a WAV-file. So time doesn't matter anymore, notes don't get skipped, etc.
    I would like to see something like this in flash, too. WITH actionscript.
    I just want flash to export one frame for each "onEnterFrame" event, NOT when the timer tells you, it's time for a "next frame". So this would mean not to trigger the onEnterEvent when the appropiate time has passed, but to trigger it, when the next frame can be exported.
    Libraries like "TweenLite/Max" are capable of doing frame-based animations, independent from the timer, so everything on that end is pretty fine.
    Would be so great if that was possible in any way.
    Is it already in CS5? Or maybe an option in CS6... argh, so many years to wait...
    until then, I have to measure the fps, look out for the lowest number, export at THAT framerate (in most of the cases just 4 or 5 fps, even on a very fast computer - just because 2 or 3 frames happen to render slower than the other 200) and afterwarts set it to 25 again (I use Blender to do this)

    Greg-
    Good Lead - Thanks.
    I learned that having skinned components (which this uses)
    keeps this preloader from working properly. The results were
    unstable. It looks like a great little preloader for other things
    though.
    I also learned that it's a problem that others have
    encountered and that hasnt been solved yet...
    ...."hello Adobe?"
    Thanks again for helping me understand this.
    JL

  • How to set an icon of a Button in ActionScript ?

    A need to create at runtime some buttons and set their icons.
    I found a problem to do that in ActionScript. In MXML is easy
    to set the icon just use a syntax like this: <mx:Button
    label="some text" icon="images/ok.png"/>
    But in ActionScript how I can set the icon ?
    I need to create the icon by a path passed as a parameter.
    Example:
    The user want to create a button with a label and an icon so
    call a method like this (that return and instance of Button):
    createButton("Update","images/update.png");
    Thank at all for the help.
    Marco

    supahsain08 wrote:
    Well i did this
    Triangle.setLocation(50, 100);
    (where Triangle is a buton)
    it doesn't do anything, stays at the same placeIt's all about context here and there are still many unknowns here that can effect your result and that you have not told us or shown us. My suggestion to you is to consider posting an SSCCE (Short, Self Contained, Correct (Compilable), Example, a condensed program similar to your current program in that it demonstrates the problem at hand, but is the smallest bit of code that still compiles and has no extra code that's not relevant to your problem. For more info on SSCCEs please look here:
    [http://homepage1.nifty.com/algafield/sscce.html|http://homepage1.nifty.com/algafield/sscce.html]
    Also, when posting your code, please use code tags so that your code will retain its formatting and be readable. To do this, you can will need to paste already formatted code into the forum, highlight this code, and then press the "code" button at the top of the forum Message editor prior to posting the message. You may want to click on the Preview tab to make sure that your code is formatted correctly. Another way is to place the tag &#91;code] at the top of your block of code and the tag &#91;/code] at the bottom, like so:
    &#91;code]
      // your code block goes here.
      // note the differences between the tag at the top vs the bottom.
    &#91;/code]or
    {&#99;ode}
      // your code block goes here.
      // note here that the tags are the same.
    {&#99;ode}good luck, pete

  • Change the "Font size" in a TLF Textfield with actionscript?

    I could not realize how should I resize my TLF Textfiels in flash cs6 with actionscript??
    None of these worked:
    if (....)
         myTLFText.textSize++;
         myTLFText.fontSize++;
    Error: Access of possibly undefined property size through a reference with static type fl.text:TLFTextField.
    I appreciate your kind help please??

    Here is the part of code I am using to resize the textfield (and other elements).
    /******SET POSITION**********/
    function setPosition():void
          //Position appBG
          appBG.height = stage.stageHeight;
          appBG.width = appBG.height;
          //Fit the appTXT in middle of screen  (AppTXT is a MovieClip contains sourceText - RTLTextField)
          appTXT.sourceText.width = stage.stageWidth * 0.9;
          appTXT.sourceText.x = stage.stageWidth * 0.05;
          appTXT.sourceText.y = stage.stageHeight * 0.1;
          //Fit the maskText layer on top of text;
          maskText.width = appTXT.sourceText.width;
          maskText.height = stage.stageHeight * 0.8;
          maskText.x = stage.stageWidth * 0.05;
          maskText.y = stage.stageHeight * 0.1;
          //Set buttons in their proper position
          if (stage.stageWidth > stage.stageHeight)
                appBG.width = stage.stageWidth;
                appBG.height = appBG.width;
          appBG.x = stage.stageWidth / 2;
          appBG.y = stage.stageHeight / 2;
    Everything works fine, but when I install the apk on my Google nexus (800x1280), the font size looks VERY SMALL and I can hardly read it!
    If I increase the Font size pt (Red Arrow in above PrntScr) to 40. then it reads perfect on phones with 800x1280 screen size. Ok?  But then any OTHER smaller screen cell phones will see the font TOO BIG!
    So I need to set the Font size pt by CODE based on a percent of stageWidth to could solve this. thx.

  • Advanced Button with Movie Clip and Fading

    Problem: I'm trying to create a bottun that when you roll
    over it it plays a movie clip and also fades in and out on roll
    out. It is similiar to the three main navigating buttons on the
    following site.
    http://www.fjcruiser.ca/
    the buttons with the compasses that appear are the ones I am
    talking about.
    I already know how to make buttons, I just can't figure out
    the actionscripting to load the movie and also fade in and fade out
    according to roll over and roll out.
    Please help. Thank everyone.

    Amazingly, I actually know exactly how to do this. And it
    only requires about 4 lines of code in the _root layer and on the
    button.
    Instead of having the rollover load an external movie, you
    want the have the rollover execute an on(enterFrame) function that
    tells each newly entered frame of your movie to check to make sure
    the mouse is still on the button, and if not, send the movie
    playhead backwards.
    So, put that sampleMovie right on the stage with the button.
    Then write the code in the _root so that says: as long as the mouse
    is over the button, the movie will advance to nextFrame(). When it
    gets to the next frame, again the code checks to see if the mouse
    is on the button, if so, the movie is instruct to go one more next
    frame (which is tweening the fade, right?) again, over and over
    until the stop() at the last frame. But, if while while entering a
    frame, the code finds that the mouse is no longer over the button,
    it does the same thing but this time instructs prevFrame(), and so
    on, going prevFrame (backwards, in other words) as long as the
    mouse is not on the button.
    The result of the above is a gradual fade in and out,
    depending on whether the mouse is hovering. This, as opposed to an
    abrupt disappearing graphic on(rollOut).
    Click the below link for the .fla that demonstrates this
    technique (which, by the way, I learned from Joshua Davis'
    excellent book, "flash to the core". Check it out at Amazon, or
    wherever. Lots of cool tricks).
    click here for
    fade_Movie example

  • Fullscreen button in Actionscript 2

    Hi everyone.  I hope someone can help me with this.  I'm having some problems making a fullscreen button in Actionscript 2 that works in a swf file.  You see, this document I'm making isn't going to be going on the web.  It's just going to be shown on a computer at company events.  However, I need a button that makes the document fullscreen, and none of the codes I've tried have seemed to work in the swf.  Here is the current code I'm working with:
    //Don't scale the movie when the stage size changes
    Stage.scaleMode="noScale";
    //Align the stage to the top left
    Stage.align = "TL";
    //Function to toggle between fullscreen and normal size
    //the toggle fullscreen button calls this function when pressed
    function toggleFullScreen(){
        //if normal size, go to fullscreen, else go to normal size
        if(Stage["displayState"]=="normal"){
            Stage["displayState"]="fullScreen";
        }else{
            Stage["displayState"]="normal";
    //Create a listener for each time the Stage is resized
    var resizeListener:Object = new Object();
    //Called each time the stage is resized
    resizeListener.onResize = function () {
        //Move the button to the center of the screen
        toggleFullScreenButton._x=Stage.width/2;
        toggleFullScreenButton._y=Stage.height/2;
    //Add the listener to Stage
    Stage.addListener(resizeListener);

    I got this compiler error: 
    Scene=Scene 1, layer=Layer 1, frame=1, Line 20
    Unexpected '}' encountered
    And yes, the instance name on the button is toggleFullScreenButton.  Here is all the AS with your code that I just tried.
    //Don't scale the movie when the stage size changes
    Stage.scaleMode="noScale";
    //Align the stage to the top left
    Stage.align = "TL";
    //Function to toggle between fullscreen and normal size
    //the toggle fullscreen button calls this function when pressed
    function toggleFullScreen(){
        //if normal size, go to fullscreen, else go to normal size
        // add a trace which appears in the output panel when you "TEST" your movie (e.g. CTRL+ENTER inside Flash)
         trace("Toggle full screen button was pressed");
         if (Stage.displayState == "normal") { Stage.displayState = "fullscreen"; }
         else { Stage.displayState = "normal"; }
    //Create a listener for each time the Stage is resized
    var resizeListener:Object = new Object();
    //Called each time the stage is resized
    resizeListener.onResize = function () {
        //Move the button to the center of the screen
        toggleFullScreenButton._x=Stage.width/2;
        toggleFullScreenButton._y=Stage.height/2;
    //Add the listener to Stage
    Stage.addListener(resizeListener);
    And on the button itself is this code:
    on(press){
        toggleFullScreen();

  • Cs 6 Having problems exporting buttons with rollover to dreamweaver

    Im trying to export out of fireworks cs6 buttons with rollover and import into dreamweaver cs6. It looks good in dreamweaver until i view it in internet explorer here is what it comes out like.

    When you created animated buttons in Fireworks and exported/imported them into Dreamweaver CS3, CS5 all worked well.
    This is because CS3 and CS5 automatically added the required preload JavaScript to the hed tag of the document.
    In CS6, this is not happening!
    That is the major reason that your buttons do not work if you are used to doing it the way that we have for years.
    As a test, I added the Head tag code that the old versions of CS generated in Dreamweaver and immediately my buttons worked.
    It must be a program error in CS6 and I wonder if Adobe will be producing a fix for this?
    The Head code is below:
    <script type="text/javascript">
    <!--
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_nbGroup(event, grpName) { //v6.0
      var i,img,nbArr,args=MM_nbGroup.arguments;
      if (event == "init" && args.length > 2) {
        if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
          img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
          if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
          nbArr[nbArr.length] = img;
          for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
            if (!img.MM_up) img.MM_up = img.src;
            img.src = img.MM_dn = args[i+1];
            nbArr[nbArr.length] = img;
      } else if (event == "over") {
        document.MM_nbOver = nbArr = new Array();
        for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
          if (!img.MM_up) img.MM_up = img.src;
          img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
          nbArr[nbArr.length] = img;
      } else if (event == "out" ) {
        for (i=0; i < document.MM_nbOver.length; i++) {
          img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
      } else if (event == "down") {
        nbArr = document[grpName];
        if (nbArr)
          for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
        document[grpName] = nbArr = new Array();
        for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
          if (!img.MM_up) img.MM_up = img.src;
          img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
          nbArr[nbArr.length] = img;
    //-->
    </script>

  • Flash animation in button states

    hello to gurus out there,
    i am trying, several days now, to attach flash animated skins
    to 3 of my buttons in a Flex application. Can somebody help me tell
    this to Flex?
    I've tried
    <mx:Button id="deleteButton"
    disabledSkin="@Embed(source='/resource/icons/delete_disabled.swf)"
    overSkin="@Embed(source='/resource/icons/delete_over.swf')"
    upSkin="@Embed(source='/resource/icons/delete_up.swf')"
    downSkin="@Embed(source='/resource/icons/delete_down.swf')"
    click="deleteClicked()"/>
    ..but with no good, i then get 200 errors in line 0 even
    after i delete the code above
    thanks is advance!

    thx Peter for your time helping me out (btw heres the
    link
    you sent me, very useful indeed) but it seems i can't still figure
    out how to skin a Flex button component with animated skins i made
    in Flash. So i''ll try explaining it better. Please bare with me.
    In my Flex application i have 2 different kind of buttons.
    One is static and that was pretty easy skinning it with the
    .swf and .css examples i found.
    Second one though, has a rotating animation on Over state
    which changes the dimensions of the button.
    In my flash file I made a movieClip (Mybutton) where i have
    the four states of my button in 4 different movieclips along the
    timeline. I labeled 4 frames according to the button state it
    holds. i then used make Flex component command to export the swf to
    Flex. And i actually see it in my custom components in Flex, but of
    course i see it as a movieclip and not a button.
    How do i tell Flex that this is a button and define its skin
    states from the frame labels in flash?
    I did try the @embed source skinning a Flex button with
    separate swf but it's totally messed up with the animation the swf
    holds. It completely distorts when i place mouse over it.
    I don't know where I'm going wrong, can somebody help me
    out??

  • Animated Flash Buttons Not Working Right

    I'm updating my website and my menu buttons have an animation on the mouseOver. A simple animated button with the "Up", "Over", "Down" and "Hit" keyframes.
    www.brenda-nies.com will show the effect of my menu buttons and the effect I want to keep. Part of my updates are switching to AS3 and that's where my problem comes in. You can't see it on the website I gave you, but in my working file, when I test it (in IE8), everything starts out fine when I first rollover my button, the animation runs through it's cycle and stops. However, if I press down on the mouse button, the animation starts over. The same when I release the mouse button, the animation starts over. I want the animation to run through 1 cycle and stop, then stay stopped until I roll off the button.
    Does anyone know what I'm doing wrong....or not doing?

    I appreciate you help, you helped me on another question before as well. However, for this particular question, I'm am already doing what your saying, at least I think I am.
    I've attached a screenshot below of what I currently have. The first layer, is all text, so...the "About Me". The second layer is my animation. That blue and black bar is actually hidden behind that grayed out "black and wood" area. That blue and black bar is also the "Button_Bar" layer in my timeline. When I rollover "About Me", that blue bar rises up and the edges fade. That all works fine and dandy. However (and I'm sorry if I'm repeating), let's say I want to go to the "About Me" section. When I click "Down" the mouse button, the animation starts over - the blue bar disappears for a split second and rises up from behind that aforementioned area. The same when I release the mouse button - the bar disappears for a split second and rises up. And I have to mention that not once did I roll off my button, yet the animation replayed with each mouse event.
    I thought maybe it was my file so I did a test and started fresh with a brand new document. Same thing is happening. I don't have any script, except for the stop script in my movie clip. Should I be using some kind of script?
    As for the movie clip, I created it using a shape tween. I also don't want anything in the "Up" state.

Maybe you are looking for

  • Applications folder crashes!

    When clicking Applications Folder in finder, finder will crash. I can't open Applications folders by any means. I tried to use Terminal to list all the files in Applications folder (-ls), but nothing showed up in Terminal. All the applications are in

  • How to control a reference type of BAM Relation to see Related Activites on BAM Portal?

    Hi. There is description of predefined reference types of BAM relations. I have created relation between two activities by adding Relationship node to one of them (to an activity that is tracking detailed orchestration). Both activity are declared

  • E520 Screen Failure

    I have an E520 - very rarely used. When using it today, the screen went fuzzy and then appeared to lock. TRied re-booting etc but the same thing continues to happen. Connected an external screen and all is well! So I can use it as long as it's connec

  • Duplicate Cover Flow on "Various Artists" Albums

    Hi. I know this has been asked a thousand times, I did do a Search and found a solution but it doesnt seem to want to work for me. The way I thought you were supposed to fix this problem is to Open iTunes, Select Every Song on the Album, Get Info, Ty

  • SMTP authentication disabled in Outlook

    Hello, Was a security or outlook update recently released that disabled SMTP authentication in Outlook 2003/2007?  I've had several users report that this has been disabled; all are using various flavors of Outlook and Windows.