Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new window java script with flash 1

Status
Not open for further replies.

killbuzz

Technical User
Mar 21, 2001
103
US
Okay i think i submitted this once but im really fustrated right now and im tired of looking of this simple script anyways. I need to know what the script is for opening new window. i have for my flash button javascript:downloads() now whats the rest of it that i put in the html i need the high width and so on i messed up on my html and had to redo it now i forgot the rest of this script. thanks hope this make sence its 3:16 am and im beat. thanks..
 
Probably best to start simple - here's a way to pop up a window of fixed size with only one parameter, the page within the window, being passed. Put this javascript in the <HEAD> of your HTML page:

<script language=&quot;javascript&quot;>

function popUp(url){
popUpWindow=window.open(url,null,&quot;width=500,height=400&quot;)
popUpWindow.focus()

}
</script>


Call it from a Flash button like this if the new page you want to load is called 'downloads':

on(release){
getURL(&quot;javascript:popUp('downloads.html')&quot;);
}


A few things to add:

Everything's customisable: you can pass more than one parameter to the javascript (you could pass height and width for example by sending three arguments to the function and amending it to suit)

If the page you want to open is remote you'll have to include a full http:// etc. URL
 
where do i put the http:// web site at i want to open?
<script language=&quot;javascript&quot;>

function popUp(url){
popUpWindow=window.open(url,null,&quot;width=500,height=400&quot;)
popUpWindow.focus()

}
</script>

where at in that script i have the flash button with the command on(release){
getURL(&quot;javascript:popUp('downloads.html')&quot;);
}
thanks
 
Not sure that I understand what you mean...

(release){
getURL(&quot;javascript:popUp('downloads.html')&quot;);
}
goes in the Flash movie itself.

The javascript part goes in the HTML page that holds the Flash movie.
 
alright the java script i know i put this in the html but where do i put the in this script
<script language=&quot;javascript&quot;>

function popUp(url){
popUpWindow=window.open(url,null,&quot;width=500,height=400&quot;)
popUpWindow.focus()

}
</script>

thanks
 
Nowhere.

(release){
getURL(&quot;javascript:popUp('downloads.html')&quot;);
}

Takes care of it - it passes the URL to the javascript which pops up the window for you.
 
all it opens is a can not display page it doesnt take me to the site i want it too the last one i had i had to put the link in the script on my html page something isnt right.. i mean if i put (&quot;javascript:popUp('downloads.html')&quot;);
in the flash all it knows is to open a page but not the link as in BTW im going to put two of these scripts in the html one for my downloads and one for the cartoons so im going to need to put the link in the script there has to be another script i went to one site that had it and explained it but i lost it and spent two hours trying to find it but came up empty. any suggestion?
 
As long as your flash movie and 'downloads.html' page are in the same directory on your server (or on your pc when you test it locally) then the pop up will work fine.

You only need one javascript function to pop up multiple pages - just change 'downloads.html' to 'cartoons.html' in the button which calls the javascript. Slainte

 
ewan i saw a page on flash kit the other day where the guy tweened the browser window...i was amazed..any ideas?..

i mean not that i would use it but just to know how it was done..and also there was one that when you clicked on the page and the flash movie opened up inside, if you moved the browser window the flash movie seperated itself from the browser and became it's own browser window..

how?..

i will try to post th links if i can find them..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Hey Carl, that's really fun site.

The browser window stuff isn't too hard to do - it's possible from Flash to send a Javascript call out to the HTML page and create those effects.

The second thing you talked about sounds similar to something I did ages ago - go to my site and then to &quot;toys&quot; - it's called &quot;boxyball&quot;. If it's what you're after mail me and I'll send you the .fla Slainte

 
A smoother effect. Here's the flash code, everything else is in the HTML page:

onClipEvent (load) {
zoom = false;//zoom is set to true by the button being pressed
size = 300;
}
onClipEvent (enterFrame) {
if (size<500 & zoom) {
getURL (&quot;javascript:changeSize()&quot;);
size++;
}
}


Slainte

 
craziness..thanks ewan...
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top