PDA

Click to See Complete Forum and Search --> : opening a new window?



cobhc
04-21-2004, 05:25 PM
can a new window be opened by pressing a button?
thanks
cobhc

apheks
04-23-2004, 12:10 PM
i do it like this:

first ad this script into the body of the html page holding your swf is in

<SCRIPT LANGUAGE=JavaScript>
function newwindow (){
window.open('newwindow.html','somename','width=320 ,height=240,toolbar=no');
}
</SCRIPT>

change anything in there you need such as width, names, height etc.

then add this to a button getURL("javascript:newwindow()")

it basically tells the javascript function to trigger and oper the new window. if anyone has a simpler way please post it cus i'm curious too

cobhc
04-23-2004, 03:06 PM
hey thanks
this is just what i need.
Another question now.lol :s. is ther anyway a new window can be opened within flash itself? I need this for the same project as i needed for that code^^^^^^^^^^^^^
thanks again
cobhc

apheks
04-24-2004, 02:21 PM
what you mean open a html window into a flash movie? you can't do that

you can use loadMovie() to load one swf into another though

cobhc
04-24-2004, 03:38 PM
sorry,perhaps i havnt been accurate in my description.
What i basically want is to open an mc by pressing a button. Ie (this isnt it but its an example) i have a game and in an mc i have sound options but that mc doesnt open until a button is pressed. However im fairly sure it needs an _root.attachMovieClip function am i right?
cobhc

Nico173
04-25-2004, 01:49 AM
how do you use the loadmovie function ? i need to do that for my flash website because i have a problem with the javascript popup...

apheks
04-25-2004, 09:10 PM
that sound example confused me more man... what is it you want to do exactly.
if you have made a movie using flash and you called it 'one.swf' and then made a second called 'two.swf', and you wanted to load the second into the first or visa versa you would use loadmovie (). If in your existing movie you had created a movie clip (saved it and everything) but have not actually used it on the timeline.. thats when you would use the attachMovie (). if you explain what you want to do it might be easier.

cobhc
04-26-2004, 02:13 PM
lol
ok ill give you a better example. Im making a game, and on this game a new window is opened with all the game options; Sound levels, quality etc. But the mc that holds all these little sliders etc is in an mc. With me?
Now the mc only exists in the library until you press the menu button. Do you get me. im farily sure i should be using attachMovie()
thanks
cobhc

apheks
04-27-2004, 03:02 AM
yep! attachMovie is the one. all you have to do is give it a name to export with, in the linkage property option. Just in case you don't know were that is right click on the name in the library and choose export using actionscript. if you did know that ignore me

cobhc
04-27-2004, 03:16 PM
Take a look at this.
What am i doing wrong lol.
thanks cobhc

apheks
04-29-2004, 07:10 AM
on (release){
_root.attachMovie("menu", "nu_name", 0)
}

this is how you use attachMovie. the first parameter is the name from the Library, the one u added using the 'linkage'
the second parameter is the name of the instance u are attaching to the Movie during runtime. so now if you want to target the attached Movie you would use _root.nu_name (_root.nu_name._x, _root.nu_name._alpha etc.)
the last parameter is used to tell the movie what level (depth) to place the new clip.

cobhc
04-29-2004, 01:59 PM
thanks again:)
ive always struggled with that.
your a legend!
thanks
cobhc

p.s. if i wanted to change the position of the menu, it would be the 0 i would change right?
so instead of 0 it would be like 5, 6?

apheks
04-30-2004, 04:46 AM
on (release){
_root.attachMovie("menu", "nu_name", 0)
_root.nu_name._x = (some number)
_root.nu_name._y = (some number)
}
once you attach the movie you can do
everything to it you can to a normal movie clip on the stage - the 0 is the 'depth'
imagine you had a stack of papers. obviouly one is ontop of the other so when you move them the highest overlaps the one underneath it and so on. the depth starts at 0 as the lowest sheet, 1 is lies on top of it 2 on top of that etc. playing with the levels is the equivalent of stacking layers on the timeline.