all groups > flash (macromedia) > september 2004 >
You're in the

flash (macromedia)

group:

FLASH BUTTON EVENT QUERY



FLASH BUTTON EVENT QUERY Jimmy Mc
9/13/2004 11:46:12 PM
flash (macromedia): i am making a website in flash..

i have an instance of a button called

prices_btn

when the user clicks the button, i want another flash file to load up (i.e
another swf file..in another window)

anyone know the ActionScript for this...

assuming both flash movies are in the same directory...


any help would be greatly appreciated

Jimmy :)
Re: FLASH BUTTON EVENT QUERY pwiop
9/14/2004 12:24:05 AM
If you are using flash buttons embedded in an html page then all you need to do
is embed the swf to be loaded into a new html page which the buttons load.

If you are wishing to load another swf into the swf (or flash player to be
more correct) that the buttons are in you could use the following AS for your
buttons 9b1 is the button name)

b1.onRelease=function(){
loadMovie("myMovie.swf",1)
}

if you use the second method you must remeber that the loaded swf will align
to the top left corner

p a u l
Re: FLASH BUTTON EVENT QUERY quimkaos
9/14/2004 2:57:36 AM
if you i understanded well all you want is to use the button has it was =
a normal link as uyo do in HTML...
so you use the getURL command and using the flash reference manual, =
select the buttom (the name dosen't matter, at least in this case), open =
the action script window and right this code:

on (release){ //----> event
getURL(url [, window [, "variables"]]); // ---> url (the file... a =
swf or a htm with an embeded swf)=20
//----> =
window (the window u want)
//----> =
"variables" (whatever data u nead to pass)
}

eg:

on(release){
getURL(file.htm,_blank); ----> in other window
}

on(release){
getURL(file.htm,_self); -----> in the same window
}

on(release){
getURL(file.htm,me); ------> in the window caled "me" (if already =
opened)
}

if you want to make a pop-up tipe window, you can also use a litle of =
javascrip... like
use a fuction on the html file that has the embeded swf:

after the tag <BODY> :

<script language=3D"JavaScript">=20
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=3Dwindow.open(URLtoOpen, windowName, windowFeatures);
}
</script>

and on the buttom:

on (release) {
=
getURL("javascript:openNewWindow'file.htm','name','height=3D300,width=3D4=
00,toolbar=3Dno,scrollbars=3Dno')");
}

if you want to load other swf movies in to the same flash player movies =
you have to use the loadMovie or loadMovieNum commands, but for that =
youi must first read something about paths and Levels in flash

hope that solves some problems...


[quoted text, click to view]
Re: FLASH BUTTON EVENT QUERY Jimmy Mc
9/14/2004 11:24:41 AM
AddThis Social Bookmark Button