hello everybody !
In my Flash Animation, I have a button. I would like that he opened a pop upâŠ
Is it possible to create a pop up with Flash ? And how ?
Could we use Javascript function in Flash ? And how ?
I know the method with dreamweaverâŠ:hangover:
Please help me
If you have some links to help me, I take !!
system
August 4, 2004, 3:17pm
2
http://www.moock.org/webdesign/flash/fscommand/
here is explained how to use flash with javascript⊠i think you will be helped with this piece of text.
system
August 4, 2004, 3:28pm
3
u can use javascript in flash like :
getURL(âjavascript:window.closeâ); but if you use quotes in the javascript, u must add \ in front of the "âŠ
yes u can create a PopUp;
add below code to your <head> tag in the html file.
[AS]
function popup(url, myname, w, h, scroll)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = âheight=â+h+â,width=â+w+â,top=â+wint+â,left=â+winl+â,scrollbars=â+scroll
win = window.open(url, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
[/AS]
put these code to your flash button:
on(press){
getURL("javascript:popup(this.href,'name','400','400','no');return false;");
}
system
August 5, 2004, 2:12pm
4
thanx for your answersâŠ(-:
2nd day, your link is good, but my english is so :h: (iâm french !) there are a lot of strange words for me.:puzzled:
e.s.x.s, i will try now your advises⊠after, i 'll say you if it work !!
thanx again !
system
August 5, 2004, 2:24pm
5
system
August 5, 2004, 3:06pm
6
sorry to learn you that it doesnât work. :jail:
iâll try with e.s.x.s method, but : or nothing happens (with the word for word codeâŠ) or it works like now (the pop up is not a pop up, the page is big !)
iâll try with the link you give me, 2nd day, but i donât understand some thingsâŠ
their code is very similar than e.s.x.s. codeâŠ
maybe itâs my fault because I donât understand all in the coding⊠itâs new for me.
the name of my html page : SoundDesignAEcouter.htm
in my AS button, do I say anywhere this name ???
in :
on(press){
getURL(âjavascript:popup(this.href,ânameâ,â400â,â400â,ânoâ);return false;â);
}
iâll try to replace ânameâ by âSoundDesignAEcouter.htmâ, like this :
on(press){
getURL(âjavascript:popup(this.href,âSoundDesignAEcouter.htmâ,â400â,â400â,ânoâ);return false;â);
}
>> doesnât work
And do I replace the values (â400â,â400â) by the size of my pop up ? >> 360x264. ???
iâll try this to :
on(press){
getURL(âSoundDesignAEcouter.htmâ,_blank);
getURL(âjavascript:popup(this.href,ânameâ,â400â,â400â,ânoâ);return false;â);
}
>> it opens my window, but not in a pop up !!!
thanx for your future helpâŠ:puzzled:
system
August 6, 2004, 1:15am
7
HTML file is:
<html>
<head>
<title>flash page</title>
<script language="JavaScript" type="text/JavaScript">
function OpenBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
</script>
</head>
<body><body>
<html>
than add the following to your flash button:
on(press){
getURL(javascript:OpenBrWindow('YOURS.htm','sound','width=300,height=300'));
}
system
August 6, 2004, 7:40am
8
ânameâ is an identifier javascript assigns to a new oppen window. So your link as esxs said should go as the first parameter (at least in that function )
system
August 6, 2004, 8:11am
9
thanks for discribing virusescu
system
August 6, 2004, 3:41pm
10
thanx e.s.x.s, but⊠mmmmhhh⊠:h:
I try your new codes and it doesnât want to workâŠ
I repair the AS code⊠you forgot some " and some â !!
thatâs like this now :
on(press){
getURL(âjavascript:OpenBrWindow(âSoundDesignAEcouter.htmâ,âsoundâ,âwidth=300â,âheight=300â);â);
}
Is the html code ok ???
When I open my html page, the navigator said me âerror on the pageâ. it opens nothing. where is my page ??? :d:
I copy-paste my html code :
<html>
<head>
<title>:: Amanite GraphoĂŻde Website 2004 ::</title>
<meta http-equiv=âContent-Typeâ content=âtext/html; charset=iso-8859-1â>
<script language=âJavaScriptâ type=âtext/JavaScriptâ>
function OpenBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
</script>
</head>
(I donât paste the bodyâŠ)
Where is the error ?? donât see⊠sorry
If you want, you can see my website, with the no-pop upâŠ
at http://www.amanite-graphoide.tk
when you are in the website, go to the âsound designâ menu. you can see the flash file (pict with the big word âsound designâ). this is an external swf called in the main swfâŠ
when you click on the button âĂ©couterâ, an html file (with a flash animation) open. Thatâs this html file that I want to be a pop-up⊠with the size : 360px x 264px.
thanx virusescu. thatâs what I thinkedâŠ