PDA

View Full Version : Actions/If else??


trowley
09-15-2005, 05:44 PM
Hi--

Being on the beginning level of actionscripting...

I am using targeting and empty mcs (for a website) to display the different pages. When a page comes in there are some animations I'd like to do(fade in/out, etc). These are currently on the timeline. When the next page is loaded, I'd like the first page to fade out, etc and the next page to fade in. There is no way to do this with the timeline, as you may know. Is there a tutorial that explains how to do this with actionscripting?

Any help would be appreciated.

Thanks

Darkware
09-15-2005, 05:57 PM
no, this is quite impossible. The practical way would be to design all pages (frames) inside different movie clips. You can fade movieclip in and out as you please on one single frame. You can simply select all that is on a frame, F8, and make it into an MC. You just have to make sure all the different MC's and present on a single frame once you have them all and initially set their alpha's to 0.

trowley
09-16-2005, 12:25 AM
Hi--

I am designing a website and am using targeting and empty mcs to load different pages. What I am wondering is that upon a swf file being loaded, I would like some animation and then when it is unloaded, I would like some animation as well (fade out, boxes collapsing, etc). I have the animations on the timeline right now, and realized that this is impossible. So is there a way to do this with actionscript? something with an if/else statement?

Am fairly new to actionscripting...

Any help would be appreciated.

Thanks.

(if you are the guy who replied to my last post, thanks, although I can't remember what section I posted it in and it's not in the new posts area)

trowley
09-16-2005, 12:51 AM
Found my post...

Thanks for the reply.

Anyway. Let me be a little clearer. I am loading swf files into empty mcs for each page. Upon the page being loaded I would like a beginning animation and when the page is unloaded, I would like to to trigger an ending animation. I have seen it done on a number of sites, and I think it's all coding. Anyway, any help with that would be appreciated.

Thanks.

J_Miller
09-16-2005, 08:20 PM
Hello...

At the same time you tell the movie clip to do its outro, set a variable on the root that will hold the value of the button you selected for later use.


_root.SelectedLink = "AboutUs";


And the end of the outro, look at the variable on the root and load the appropriate movie.


if (_root.SelectedLink == "AboutUs"){
LoadFrame_mc.loadMovie("AboutUs.swf");
}


Just a basic example.....but if you expand on that, you should be able to achieve what your trying to do using timelines and simple scripts.

Hope that helps.

trowley
09-17-2005, 07:23 PM
Thanks for the reply...

I will try the code you gave me, although how would i trigger the outro? Using a goto and play command? Does all that code go on the button?

Also, what about something like this:

Something with an if/else statement. on press, if current page = "page.swf" than load "outro page .swf" when complete load "nextpage.swf"

Code that into each button for each of the pages.

Does that logic make sense? and if so, how would I code that?

Any help would be appreciated.

trowley
09-17-2005, 09:20 PM
Hey Thanks,

I got it to work using your code!!

You can check it out when it's up at:

http://www.trowley.com

in the trowley designs section

Thanks again.

J_Miller
09-18-2005, 05:20 PM
Awesome....Glad it worked.