Hi there.
I have a question about a function of Open Browser Window in FlashMX.
I tried a couple of online tutorials, but these did not work. Actually I did not understand how to make this function work.
My problem is here:
I created index.html in FMX. When viewers click on “ENTER,” it opens a new browser window, which is intro.html (width: 700, hight: 500, no bars, no scrolls). I know I have to go to “GetURL” in FMX and type action script, and after that go to DreamWeaver to type Javascript in code. But I don’t know what I should type in both programs. Those tutorials I tried were not detail for me, so I need very detail explanation.
I started using FMX 3 months ago, I have alot of things I dont know yet. So I need TOO detail instruction.=)
I hope somebody helps me to solve this problem. I am not American, and if you didnot understand my English, forgive me.
Please HELP!!!
There are a few ways to do this, but I’ll show you the way I’m familiar with.
First paste this javascript into the < head > section of your HTML document.
<script language="JavaScript">
function openWin(url, w, h)
{
var winprop = "width=" + w + ",height=" + h;
openwin = window.open(url,'',winprop);
}
</script>
Next apply this action to your flash button that you’re using to launch the pop-up.[AS]
on (release) {
getURL(“java**script:openWin(‘yourpage.html’, ‘700’, ‘500’)”);
}
[/AS]
I already specified the width and height you wanted in the code, all you have to do is change “yourpage.html” to whatever html page you want to link to. I hope that helps. =)
Ok, let me explain what I am confusing.
I created index.fla, index.swf, and index.html. There is a button in index.html, and when you click that button, it opens new window which is called open.html ( that is published from open.fla).
In the HTML file, I should type Javascript in “open.html” or “index.html?” I am sorry, this might be a stupit question for you, but I am confused. But if I type HTML code first in the index.html in DreamWeaver, and then type actionscript in Flash, I have to publish that file again, right? If I do that, it creates new html file in flash and delete the Javascript which I typed in DreamWeaver.
I have to type action script in expert mode in Flash, right? I just want to make sure I am doing right.
Also, I don’t have to change the number or add the number when I type javascript in HTML file, right? It is ok to just copy and past you typed?
I hope I can make it.
Thank you again, electrongeek.
The javascript I posted above should be pasted into index.html because that is where your flash button is placed.
You can prevent flash from publishing another index.html page by simply going to File > Publish Settings and uncheck HTML so that it won’t publish another index.html page.
And the only thing you need to change in the actionscript above is where it says “yourpage.html” to “open.html” since that’s the page you’re trying to open with the pop-up.
Also you can just copy and paste the actionscript into flash using the expert mode.
:( :( :*(
I think computer does not like me.
I pasted everything correctly, but it did not open browser window, I mean it did not even link to open.html…
You said you “pasted” the code into your html file. But make sure to change the “about :” in the javascript to “javascript:". You see, when you type in "javascript” on this forum, it is automatically changed to “about :”. So the code will be like this:
[AS]
on (release) {
getURL(“java**script:openWin(‘yourpage.html’, ‘700’, ‘500’)”);
}
[/AS]
Just wanted to mention this, because you clearly said you pasted it, and thus you might have copied the “about :” instead of the “java**script”