?
Solved

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

Posted on 2004-04-01
5
Medium Priority
?
411 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
3 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 200 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
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 shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses
Course of the Month15 days, 8 hours left to enroll

850 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