How to create a fulllscreen toggle button in Flash AS2

George Baker
I am a interactive freelance designer. Working mostly on complex flash websites in AS3. I would like to give some easy tutorials for beginners. And help them see actionscript more easily laid out clean.
View all articles by George BakerDownload The Caurina Tweener. Available from code.google.com. And place it in the folder where your flash file is. Open Flash, Then AS2 Flash Document. On the first line of actionscript insert the following code:
import caurina.transitions.Tweener;
This imports the class to use in our application. Then...
var base:Object = this;
This is a root identification variable that allows us to use variables from the root level without any hassle.
Secondly
Create a random movie clip and fill it in with a square or whatever shape you like. Give this movieclip the instance name of fullscreen_button
Thirdly
This is the function.
// Main Function called fullScreenSetup
var fullScreenSetup:Function = function () {
// Uses Caurina Tweener To Give a RollOver Effect
base.fullscreen_button.onRollOver = function () {
Tweener.addTween(this, {_alpha:50, time: 1, transition:"easeOutExpo"});
}
// Reset's the animation when roll out.
base.fullscreen_button.onRollOut = function () {
Tweener.addTween( this, {_alpha:100, time: 1, transition:"easeOutExpo"});
}
// When pressed, it runs an if statement.
base.fullscreen_button.onRelease = function () {
// If the stage is normal, fullscreen is activated. If not nothing happens.
if (Stage["displayState"] == "normal") {
Stage["displayState"] = "fullScreen";
} else {
Stage["displayState"] = "normal";
}
}
}
Finally
To initiate this function simply place this code whereever you want the function to run.
fullScreenSetup();
NOTE: Make sure your html document allows fullscreen mode otherwise it won't work.
Spread The Word
7 Responses to "How to create a fulllscreen toggle button in Flash AS2" 
|
said this on 18 Apr 2010 2:54:21 AM CDT
Thank you for your Flash
|
|
said this on 19 May 2010 2:15:54 PM CDT
Ive used this code in man
|
|
said this on 31 May 2010 6:49:10 PM CDT
An easier way would be to
on(press){ f } And this on t on(press){ } |
|
said this on 30 Sep 2010 2:37:19 PM CDT
excellent i really apprec
|
|
said this on 26 Oct 2010 10:28:12 AM CDT
excuse me ive just start
|


Author/Admin)