This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Flash Site Design > May 2004 > Java script to open centered window for swf?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Java script to open centered window for swf?
|
|
| digiconquest2 2004-05-18, 7:38 pm |
| OK, i am very confused. If someone could explain a little better, cause i am
new to javascript etc...
I want to have my Flash index page open my site in a new window like this
www.skillet.org.
I downloaded some directions:
They go as follows:
Place this javascript in between your <head></head> tages.
<script language="javascript" type="text/javascript">
function popup(width, height, filename)
{
var left = (screen.width - width) / 2;
var top = (screen.height - height) / 2;
var attributes = "left=" + left +
", top=" + top +
", width=" + width +
", height=" + height + ", ";
attributes += "toolbar=0, location=0, directories=0, ";
attributes += "status=0, menubar=0, scrollbars=0, ";
attributes += "resizable=0";
window.open(filename, "appwindow", attributes);
}
</script>
The use this actionscript function on your button to launch the noew window.
getURL("java script:popup('700' , '400' , 'newWindow.html')");
BUT!!!
where do i put the javascript?
In the html page of my Index page or the html page of the movie i want to
open..
Do i have to change some of the text in the description above to fit my movie.
If so which parts.
Lastly
Where do i put the getUrl command, and do i have to edit that also to fit my
movie
Thanks sorry if this is elementary.
| |
| NSurveyor 2004-05-18, 11:29 pm |
| I think the javascript goes in the html page of your Index page.
Paste:
on (release) {
getURL("javascript:popup('700' , '400' , 'newWindow.html')");
}
into your buttons actions. Your button's actions can be edited by first
selecting your button, then pressing F9 on your keyboard.
Just paste my actionscript above into the button's actions.
| |
| digiconquest2 2004-05-18, 11:29 pm |
| i got the popup window to open, but there is nothing in it.
I pasted the java script in the html of my index.html
i set the action script in my button actions of the index.swf
Where do i set the action to open my MainMenu.swf which is what i want to
open in the new window.
It doesn't look like i've done that.
Also
take a look at the java script above and tell me if it's ok
or if i have to modify it to fit my needs
thanx
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|