Solved

Simple toggle for fscommand ("fullscreen", "true"); then on next click flase

Posted on 2004-04-01
5
378 Views
Last Modified: 2008-02-01
Hi all,

I am trying to create a simple fscommand that when clicked changes from true to false. Then on the next click for flase to true etc / on off etc.

But I cant seem to get it to work. All I am doing is changing the true/face attribute, when the button is clicked it goes to frame 2 (for a different button face) then when the button in frame 2 is clicked it goes back to frame 1. The frame changing is working button not minimize or maximize of the window is happening.

//Frame 1:
MYwindowMode= true;
fscommand ("fullscreen", MYwindowMode);


//button_mc: Frame 1;
on (press) {
this._parent.gotoAndStop(2);
_root.MYwindowMode= !_root.MYwindowMode;
fscommand ("fullscreen", _root.MYwindowMode);
}

//button_mc: Frame 2;
on (press) {
this._parent.gotoAndStop(1);
_root.MYwindowMode= !_root.MYwindowMode;
fscommand ("fullscreen", _root.MYwindowMode);
}


Any help is really appreciative or if someone knows a simpler way to do this please let me know!
0
Comment
Question by:complexlty
  • 2
5 Comments
 
LVL 39

Expert Comment

by:blue-genie
Comment Utility
hey, i just copyied and pasted  your code, and with exception to the fact that this._parent seemed a tad obsolete (I'm assuming that you have the buttons directly on the root) the code is working fine.

You are aware you need to run the swf to test this right?

blu.
0
 
LVL 9

Accepted Solution

by:
krishnaprathab earned 50 total points
Comment Utility
Hi complexlty,

 The problem is very simple. When you press on youR button your first actions asks the timeline to
move to the next frame and after that you are using fscommand ,so at this instance the timeline has
already moved and so your fscommand is not getting executed. Just reposition your action and it WILL work.

Change you action to :

//Frame 1:
MYwindowMode= true;
fscommand ("fullscreen", MYwindowMode);


//button_mc: Frame 1;
on (press) {
_root.MYwindowMode= !_root.MYwindowMode;
fscommand ("fullscreen", _root.MYwindowMode);
this._parent.gotoAndStop(2);
}

//button_mc: Frame 2;
on (press) {
_root.MYwindowMode= !_root.MYwindowMode;
fscommand ("fullscreen", _root.MYwindowMode);
this._parent.gotoAndStop(1);
}

 And the answer to your second question is : I dont find any other better way, logic differs from
person to person and so we cant really say this is the best way. Your logic looks good already so
proceed and have fun.

Let me know if this worked.

Thanks,
KP
0
 
LVL 9

Expert Comment

by:krishnaprathab
Comment Utility
Hi,

Did my reply answer your question. If so please close this question or if you need some more help on this feel free to ask.

Thanks,
KP
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now