Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-04-01
5
Medium Priority
?
408 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
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 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.
Suggested Courses

610 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