Be a Supporter!

Full Screen Mode

  • 412 Views
  • 7 Replies
New Topic Respond to this Topic
Aprime
Aprime
  • Member since: Aug. 15, 2005
  • Offline.
Forum Stats
Member
Level 48
Game Developer
Full Screen Mode 2009-09-16 13:07:10 Reply

I have this code for full screen, on a button

on (release)
{
    Stage.displayState = "fullScreen";
    gotoAndPlay(2);
}

and this one to make it back to normal

on (release)
{
    Stage.displayState = "normal";
    gotoAndPlay(1);
}

But it doesn't work.. and gives this error...

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 3: There is no property with the name 'displayState'.
Stage.displayState = "fullScreen";

**Error** Scene=Scene 1, layer=Layer 1, frame=2:Line 3: There is no property with the name 'displayState'.
Stage.displayState = "normal";

Any idea's of how to fix this?


Fan me up | Twitter l My Website l YouTube (Please Subscribe)

BBS Signature
ShizzleCreature
ShizzleCreature
  • Member since: Mar. 20, 2008
  • Offline.
Forum Stats
Member
Level 23
Artist
Response to Full Screen Mode 2009-09-16 13:16:30 Reply

lol
i think you have put it on the main timeline or on a frame instead of on a button actions


BBS Signature
VanVeenGames
VanVeenGames
  • Member since: Feb. 11, 2009
  • Offline.
Forum Stats
Member
Level 11
Game Developer
Response to Full Screen Mode 2009-09-16 13:32:43 Reply

Or you have Flash v.8 or earlier. displayState was introduced in Flash CS3.


Vexagon is dead. This is VanVeenGames!

BBS Signature
Aprime
Aprime
  • Member since: Aug. 15, 2005
  • Offline.
Forum Stats
Member
Level 48
Game Developer
Response to Full Screen Mode 2009-09-16 13:55:01 Reply

At 9/16/09 01:16 PM, BloodSucker150 wrote: lol
i think you have put it on the main timeline or on a frame instead of on a button actions

I put it in a button lol

At 9/16/09 01:32 PM, Vexagon wrote: Or you have Flash v.8 or earlier. displayState was introduced in Flash CS3.

Nah.. I have CS3.. doesn't work though.. its flash 9 not 10 though..
Maybe that's it?


Fan me up | Twitter l My Website l YouTube (Please Subscribe)

BBS Signature
milchreis
milchreis
  • Member since: Jan. 11, 2008
  • Offline.
Forum Stats
Member
Level 26
Programmer
Response to Full Screen Mode 2009-09-16 13:59:14 Reply

to access the stage in AS3 you have to use "stage" and not "Stage".

like the other things:

stage.scaleMode ...

ShizzleCreature
ShizzleCreature
  • Member since: Mar. 20, 2008
  • Offline.
Forum Stats
Member
Level 23
Artist
Response to Full Screen Mode 2009-09-16 14:23:19 Reply

so it suppose to work only if you are using AS2..


BBS Signature
Snow-Fox
Snow-Fox
  • Member since: Mar. 23, 2005
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to Full Screen Mode 2009-09-16 22:35:30 Reply

I had full screen for a cartoon, I used AS 2.0 and I had a toggle button, and a frame at the start of the movie with some Actionscript.

Movie frame ActionScript

function toggleFullScreen(){
	//if normal size, go to fullscreen, else go to normal size
	if(Stage["displayState"]=="normal"){
		Stage["displayState"]="fullScreen";
		_root.dood.lol.gotoAndStop(2);
	}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 the button was

on(press){
	toggleFullScreen();
}

hope that works for ya

henke37
henke37
  • Member since: Sep. 10, 2004
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Full Screen Mode 2009-09-18 06:36:30 Reply

And the actual issue was that the flash compiler used is too old to recognize the property. By using the dynamic property name style, the compiler skips checking the property name and hopes for stuff to work at runtime.


Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.