PDA

View Full Version : Flash actionscript?


allanmcllin
09-11-2007, 01:33 AM
I'm making a flash web site at the moment for <url removed> client but I’m struggling with an effect that I’m trying to make. I want this to happen on my page: when people press a button to change the page, I want to make the previous page slowly disappear before the next page appear. I believed it requires some action scripting but I’m useless at that, can anyone please help?

forlamp
11-15-2007, 08:24 PM
The only way you would need actionscript is if the entire page was a flash object.

Otherwise you'd be looking at javascript

cchana
11-16-2007, 04:46 AM
^ yes that's true, you should consider the script.aculo.us js framework for that, although those kind of effects don't always work as well in practice imo.

famousb
11-16-2007, 08:10 AM
if your whole site IS done in flash, it's actually relatively simple - and does require just a bit of actionscript...

the basic premise is this...
you set all your pages in different frames of the same movie clip, w/ a fade in prior to the mc, and a fade out after.... for demonstration, say 10 frames for each...

so frame 1 would be page1 w/ alpha = 0.
frame 10 would be page1 w/ alpha = 100. you would also want to put a stop(); statement here...
frame 20 would be page1 w/ alpha = 0 again...

frame 21 would be page2 w/ alpha = 0,
etc....


now, you also are going to want to name the first frame of each page tween, where alpha starts at 0, with something to the effect of "page1", "page2", etc...

and in the last frame of each page tween, where alpha = 0 again, put in the as;
gotoAndPlay("page"+_root.pg);

now for your buttons, you put this in
on (release){
if (_root.pg <> 1){
_root.pg = 1;
_parent.play();
}
}

obviously, the 1 should be changed to the corresponding page for each button...


HTH.

joebert
11-16-2007, 08:28 AM
What version of Flash ?

The methods are drasticly different between Flash 6, 7/8, & 9.