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();

Similar Messages

  • Is it possible to have a fullscreen button on a video within Flash?

    I have an external video playback in a website I'm making in Flash with actionscript 3.  Is it possible to create a working fullscreen option for that video?  I noticed some of the skins have fullscreen buttons but that don't actually work when you click on them.  Ultimately I wanting to make my own fullscreen button but if the preset ones don't even work I'm wondering if it's even possible.
    Thanks.

    fullscreen skin buttons work.  but make sure you're publishing for 'flash only - allow fullscreen' (file>publish settings>html>template)

  • How do I add a FullScreen button to Project Playback Skin?

    How do I add a fullscreen button to the project playback skin? I know how to load another skin (using Project -> Skin Editor) and how to add a custom playback skin (paste custom skin SWF into C:\Program Files\Adobe\Adobe Captivate 5\en_US\Gallery\Playbars) but I'm having a little trouble figuring out how to add a fullscreen button when editing the Flash AS3 so that it will show up in my custom playback skin when loaded into Captivate via Project->Skin Editor. Any ideas?

    Hi there
    I might assume that seeing as you were able to work the magick with the CC button it would be a simple task to pick apart the other elements and add the desired button without hijacking the CC button.
    I mean, if you are that deep in Flash territory and all, it doesn't seem like much of a stretch to figure out how the buttons are added, no?
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcererStone Blog
    Captivate eBooks

  • How to make a fullscreen button for Flash Catalyst?

    Hey everyone.  I really hope someone can help me with this.  How can I make a fullscreen button in Flash Professional that would make my Flash Catalyst project go fullscreen?

    I'm sorry I really don't know Flash Catalyst as much as I'd like to. Designing interfaces is left up to me, no designers at my agency use Catalyst. Though this is the Flash forum so that's as much as I can tell you. I didn't know Catalyst didn't support basic scripts (I thought I read that it did).
    Ultimately, for a very cheap price you can do something like go to http://www.lynda.com/ and buy a membership. Dirt cheap compared to what you get. They offer many courses on all this stuff and I'm sure your answer would lie in one of the (nicely broken up by subject) video training videos.
    Just searching for Catalyst brings up a bunch of courses:
    http://www.lynda.com/search?q=catalyst&x=0&y=0
    edit:
    For instance I watched the essential CS5.5 training and I saw in 2 minutes flat that when you click on a button you should have an "Interactions" panel that lets you do things. If they didn't put fullscreen as an interaction that's another thing but I'm just pointing out it's very easy to learn how to do all sorts of things in video training. If you do not want to purchase a membership there just find a video you think would have the info in it and I'll watch it and let you know if it told me how to do it, and how to do it.

  • 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

  • Can I parameter a fullscreen button in a captivate project?

    Can I parameter a fullscreen button in a captivate project?

    Hi there
    I'm not sure what you are asking. What do you mean when you say "parameter a button"? Are you wanting to create a button with actions that accept different values?
    Cheers... Rick

  • Mute and unmute button is actionscript 3.0

    Hi,
    I am wondering how to make a mute and unmute button is actionscript 3.0.  I did it before in actionscript 2.0 but not in 3.0.
    Here is my actionscript 2.0 code.
    var sound = 1;
    var slashMC = _root.attachMovie("slash","slash01",99);
    slash01._visible = false;
    slashMC._y = btn._y;
    slashMC._x = btn._x;
    var s:Sound = new Sound();
    s.attachSound("Gravy");
    s.start(1,999);
    btn.onPress = function(){
    if(sound==1){
      s.stop();
      slash01._visible = true;
      sound = 0;
    else if(sound==0){
      sound = 1;
      slash01._visible = false;
      s.start(1,999);
    Thanks

    Try this:
        import flash.display.MovieClip;
        import flash.events.*;
        import flash.media.*;
        import flash.net.URLRequest;
            var isPlaying:Boolean = false;
            var snd:Sound = new Sound();
            var channel:SoundChannel = new SoundChannel();
            var pos:Number = 0;
            var soundVolume:Number = 1;
                snd.load(new URLRequest("something.mp3"));
                btn_Stop.addEventListener(MouseEvent.CLICK, stopMusic);
                btn_Stop.buttonMode = true;
                btn_Play.addEventListener(MouseEvent.CLICK, playMusic);
                btn_Play.buttonMode = true;
             function stopMusic(evt:Event):void
                channel.stop();
                pos = 0;
                isPlaying = false;
             function playMusic(evt:Event):void
                if(!isPlaying)
                    channel = snd.play(pos);
                    btn_Play.visible = false;
                    btn_Pause.visible = true;
                    isPlaying = true;

  • How to have a fullscreen button in flv player , and where to find other skin player ?

    hi !
    i currently use Dreamweaver CS5 to build a page that plays a FLV video.
    i use the insert flv media feature from dreamweaver, to insert the flash player into the html code.
    it works fine but :
    - it didn't have a fullscreen button (none of the 3 skins (clear , halo, corona)
    so where can we download more skin with more feature (dreamweaver compatible off course) ?
    thanks for help
    Mike

    this solution is not profesional at all. we're a firm...
    OK. DW doesn't provide much.  Short of building your own custom player in Flash Professional,  look in the Adobe Exchange (see link below)
    http://www.adobe.com/cfusion/exchange/index.cfm?searchfield=Flash+player&search_exchange=3 &search_category=-1&search_license=&search_rating=&search_platform=0&search_pubdate=&num=2 5&startnum=1&event=search&sticky=true&sort=0&rnav_dummy_tmpfield=&Submit=
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • InDesign CS6, fullscreen button on controller does not expand video

    I placed a video file in InDesign and when I export the video to SWF, all my other animations and transitions works. My video plays, all the other controller options work, however when I click on the full screen option, it changes the resolution of my screen but only places the video itself in the top left corner of the screen and does not expand it across the screen.
    Here is what it looks like after I click the fullscreen button. Anyone have any ideas what might be causing this or how to fix it?

    Try to disable the hardware acceleration in the Flash Player.
    See [[Cannot view full screen Flash videos]]
    * http://www.youtube.com/swf_test.html (right-click the player: Settings)
    Flash "Display settings" window:
    * http://www.macromedia.com/support/documentation/en/flashplayer/help/help01.html

  • Fullscreen Button

    I am going to begin posting some custom skinnable components to start this forum off.
    FlashCats has written a Fullscreen Button custom skinnable component.
    The idea is, you can click the button and your application will go fullscreen. How cool is that?

    It's cool, but if you try to bring the button into Flash Catalyst CS 5.5 like I did, you can't use it.  A message pops up saying that you have to update the file in an older version of FC.

  • Fullscreen button outside the swf?

    Hi,
    I don't know anything about Flash, so please be gentle with me....
    I have a swf file that doesn't have any fullscreen button although it's prepared for fullscreen anyway.
    Now I'd like to have some kind of button beside/under or elsewhere in the html that can activate the fullscreen mode for the swf.
    If it's possible to do this with a regular image, AS3 and html instead of creating a flash movie, that would be nice (see, that was probably a stupid qestion) as I have tried and tested half a dozen flash tutorials to no avail.
    Oh, and IF the only way to do it is to create a button in flash, it need to be transparent.....
    Thanks in advance for hints and help.

    if it's a web-based swf, the button needs to be in the swf.  a transparent button is fine.

  • 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

  • Help with Buttons in Actionscript 2

    Help!! I am creating a Flash movie with 5 scenes. I have
    buttons for each that I have added actionscript to, but they still
    do not work. I am not getting any error messages. I am using
    actionscript 2 and have gone step by step. here is what i have :
    on (release) {
    gotoAndStop("main", 1);
    on (release) {
    gotoAndStop("blackboard", 1);
    etc for the rest of the buttons. Any help would save me much
    stress as I am trying to finish a project for school!!! thanks
    ah

    Try adding _root. before the gotoAndStop command. If you have
    the code on the buttons that is.

  • Enabling and disabling buttons in actionscript

    in flex i love using the enabled option for buttons (so when the user has not yet selected something in a datagrid or if a variable in the app is not properly set the button will not be enabled and will be grayed out... but once the condition is true the button automatically becomes enabled) like this:
    <mx:Button 
    label="Save Changes" icon="@Embed(source='images/disk.png')" click="saveData();"enabled="
    {firstID != 0 &amp;&amp; changesMade == true}"/>
    i have a control bar that has buttons but if the user is an Admin they have additional buttons (which i created using actionscript in an initApp() function once the app initializes like this):
     if (adminList.indexOf(Application.application.parameters.emplid) != -1){ 
    var but:Button = new Button();but.label =
    "Delete Account";but.addEventListener(
    "click",confirm);but.setStyle(
    "icon", deleteIcon);  
    this.toolbar.addChild(but);}
    how can i code the enabled function that i use i mxml in actionscript in the code above?

    oops i just realized i forgot the return type.
    this is helpful when the button is first created and the app is first initialized... but i need this button to automatically become enabled if the user does something (like click on a datagrid) and automatically disabled when the user clicks off of the datagrid (or some action that would enable/disable the button).
    public function loadAdmins(returnedEvent:ResultEvent):void {adminList = returnedEvent.result[0].DEPT_LIST;
    if (adminList.indexOf(Application.application.parameters.emplid) != -1){ 
    var delBtn:Button = new Button();delBtn.label =
    "Delete Account";delBtn.addEventListener(
    "click",confirm);delBtn.setStyle(
    "icon", deleteIcon);delBtn.enabled=delBtnEnabled();
    this.toolbar.addChild(delBtn);}
    public function delBtnEnabled():Boolean{ 
    var returnVal:Boolean; 
    if (firstID != 0){returnVal =
    true;}
    else{returnVal =
    false;}
    return returnVal;}

  • Buttons in ActionScript 3 ?!?!?!

    hi...
    I'm trying to make a sound controller in actionscript 3. I
    used to do this nicely in actionscript 2, but know it seems that
    nothing works as in "the old days"...
    I created a button and tried to add actionscript to it but it
    doesn't let me :-(
    How can i apply code to a button on flash CS3 to start and
    stop a specific sound?

    ActionScript 3.0 was designed for advanced Object-Oriented
    programmers. Even though this approach is a lot more powerful, it
    requires a lot of knowledge and re-learning. Like for example that
    every on() event is not only deprecated in this version but
    completely removed. So, as the same documentation says. If your
    project is not a giant monster, there is no need to learn this
    programming approach, which will take you a considerable time. You
    can still export as Flash Player 9 to use its improvements but
    select ActionScript 2.0 as the ActionScript version on the publish
    settings panel.
    Take into account that the object structure in ActionScript
    3.0 was completely redesigned. So every proccess, from a sinple
    event to movie clip creation has changed radically.

Maybe you are looking for