Solved

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

Posted on 2004-04-01
5
380 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
ID: 10738896
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
ID: 10773232
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
ID: 10824977
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to record live broadcast.

896 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

15 Experts available now in Live!

Get 1:1 Help Now