PDA

View Full Version : A couple actionscript questions



nycbrian
June 23rd, 2004, 09:28 AM
Hi all,

Second post here at Kirupa, thanks for the quick response on the first. Basically, I am new to flash and actionscript and I want to get an idea on how the majority of people structure the flash websites they make.

First, do most of you actionscripters, when creating a website, use a parent movie that holds the sites navigation and an embedded blank movie clip to load individual content pages? I get the feeling that is true because it saves a lot of space in your swf file.

That was the easiest question. Next, when you create a transition effect to keep the viewer occupied between loading different pages, how do you usually go about this?

Assuming you have a blank movieclip in the main SWF to load individual page content. Do you have a movieclip animation that is called in the main SWF that is a layer above or masks the container movieclip which is loading the external content? Or, do you have the transition in the actual content SWF, with a transition in effect, midframe with the content, then transition out effect.

It seems the second choice might be a little more repetitive, but maybe a little more simple, then again, maybe not.

My last question is not actionscript but javascript. I want to load my flash file from a link on an html page that launches a new window that is perfectly sized around the flash movie, with none of the menu bars and that works on windows(ie, netscape, opera) and MACs. As a secondary, if its possible, I would like to have the flash movie pop up into the center of the screen, right now it pops into the top left corner.

Here is the script I have. It works for PCs with IE, but a friend that looked at it on her MAC had to resize the window:


<A HREF="" onClick="window.open('flashmovie.html', 'newWnd',
'width=750,height=400'); return false;">Try this</A>

The flash.html is the automatic html page that flash publishes your SWF file.

Thanks,
Brian

Prophet
June 23rd, 2004, 01:31 PM
first question basically yeah i do,
second what i normally do is have a separate "page wipe" movieclip that plays and switches content when its all covered up but this is basically cheating and the only way this works properly is because most of my content is not image heavy and is basically all loaded in one go... but as projects become heavier im gonna have to add a little animation or wipe kinda thing to the preloader frames igues...

with regard to the third question.
i dont have a mac (i actually hate the buggers but ther u go ;) lol)
if you want to have it centered, use the screen.width and screen.height properties to determine the x and y values respectively and add it into the width, height bit (ie. "xa = screen.width-750; xb=xa/2" and then you would have this code instead

<A HREF="" onClick="window.open('flashmovie.html', 'newWnd',
'width=750,height=400,x=xb,y=yb'); return false;">Try this</A>just make sure you calculate xb and yb before it is called....
ill investigate as to the mac problem for you but i cant guarantee anything....
......and may i say you use exactly the same dimensions as i do ;) lol

Prophet.