Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > HTML and JavaScript

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-05-2004, 03:00 PM   #1
isomega1
Registered User
 
Join Date: Aug 2004
Posts: 2
Lightbulb changing focus between windows

I need to get two separate flash movies in two separate windows to communicate, this is the set up:
A movie in the main window calls a pop up win which contains a quiz swf, I need a button on this quiz which will cause this window to minimise without refreshing etc. I then need a button in the other swf in the main window to maximise this pop up swf without reloading or refreshing it so that a partially filled out quiz can be revisited as required. Basically I need to recreate the effect of Alt + tab between the two windows with flash buttons....
whats the action script I need on the buttons?

thanx for any sugestions???

i.
isomega1 is offline   Reply With Quote
Old 08-05-2004, 03:29 PM   #2
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default

focus() is one way to do this:

popupWindowName.focus();
this will give focus to the popup window

then on the popup window you would have :
opener.focus(); (opener is a keyword representing the window the opened the popup).
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 08-05-2004, 04:05 PM   #3
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default

here is some code:
Code:
<script type="text/javascript">
	var pops;
	function popit(){// this opens the popup.
		var params="width=200, height=200, toolbar=no, statusbar=no, resizable=no";
		pops=window.open('mypop.html','pops',params);
	}
	function switchWithPops(){
	    pops.focus();// this actually gives focus to the popup - called from flash
	}
</script>
this script goes on the html page that has your 'main' flash file embedded in it.

this would be the code inside your 'main' flash file:
Code:
btn.onRelease=function(){
	getURL("javascript: pops.focus();");
};

delay=function(){
	getURL("javascript: popit();");	
	clearInterval(inter);// turn off the delay.
}
//built in delay: delay popup for 1 second.
var inter=setInterval(delay,1000);
now here is the code for the 'popup' flash file:
Code:
btn.onRelease=function(){
	getURL("javascript: opener.focus()");
};
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:30 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.