PDA

View Full Version : BASE:The Best Structure for your Flash Site


Tillie
12-29-2006, 12:50 PM
Hi everyone!

I have a question regarding mentioned article!
I'm working on a project that will be structured as written, and if someone can give me some hints on how to apply a RollOver state on a button! I've attached another MovieClipLoader, and the output panel traces my rollOver .swf's.
The problem i'm having is at the end....how to make flash recognize which button needs the rollOver state and applys it in the right place!!

thanks for your time:hugegrin:

Dazzer
12-29-2006, 12:54 PM
AS3 or AS2?

Tillie
12-29-2006, 12:58 PM
AS2

Dazzer
12-29-2006, 01:01 PM
on (rollOver)
{
trace(this + " has been rolled over");
}
on (rollOut)
{
trace(this + " has been rolled out");
}


that's just the basics. if you need more, ask.

Tillie
12-29-2006, 01:06 PM
yes! it's working...and now how do I apply rollOver.swf to the right button?

thank you so much

Dazzer
12-29-2006, 02:12 PM
what do you mean rollOver.swf ?`

Tillie
12-29-2006, 03:10 PM
sorry....i was confused :blush:
the thing is that i dont want my menu to have image buttons but animated .swfs!
so i load them and they do open as animation, but wont react to nither rollOver nor to rollOut state....but output shows i've rolled over one of them...

.swf i'm loading works fine...

thank you...

Dazzer
12-29-2006, 03:11 PM
now you're getting complicated.

send me a fla.

Tillie
12-29-2006, 03:21 PM
it's exactly the same as the article 'The Best Structure for your Flash Site'
http://www.kirupa.com/developer/flash8/best_structure_flash_site.htm

the only difference is that i want animated .swfs not .jpgs for buttons

thanks

Dazzer
12-29-2006, 03:23 PM
on (rollOver)
{
trace(this + " has been rolled over");
this.play();
}
on (rollOut)
{
trace(this + " has been rolled out");
this.stop()
}
onClipEvent(load)
{
this.stop();
}


try. hope that works.

Tillie
12-29-2006, 03:29 PM
it's not working

maybe there's something like _lockroot ... maybe something's overlaping

anyways thanks for your time :)

Dazzer
12-29-2006, 03:31 PM
that's the thing. I don't understand the structure of your fla, I can't really help you. and I ain't reading that whole tutorial

The above assumes this structure

main
--> Button < --- Loaded Swf

If your structure is this

main
--> button
--> myClip <---loaded SWF

then simply change the code to reference the clip, not just the button.
- god some people... -

on (rollOver)
{
trace(this + " has been rolled over");
this.myClip.play();
}
on (rollOut)
{
trace(this + " has been rolled out");
this.myClip.stop()
}
onClipEvent(load)
{
this.myClip.stop();
}

RileyBoy
12-29-2006, 03:48 PM
seems like you're making things way harder than they need to be. Instead of loading external swf's for button rollovers, just make the animation in a movieclip, and use that clip as your button... make sense?

Dazzer
12-29-2006, 03:49 PM
he says he has no problems loading the swfs.

So the code applies. its the structure that i need to know

Tillie
12-29-2006, 04:51 PM
here Dazzer , i'm sending .fla
it's the source i downloaded from the previous mentioned link.

i think i'll sleap it over maybe tomorow i'll see it diferently:tired:

RileyBoy
12-29-2006, 06:30 PM
sorry, I didn't mean your solution Dazzer... I just meant this particular approach to rollovers..

Dazzer
12-30-2006, 02:02 AM
astrImages[i]

You can put links to your swfs inside your XML, so that it will be added into this array.

Don't have to do some funny "loadMovies" inside your target_mc.

scotty
12-30-2006, 04:58 AM
astrImages[i]

You can put links to your swfs inside your XML, so that it will be added into this array.

Don't have to do some funny "loadMovies" inside your target_mc.
But as long as they are (external) swfs you have to load them ie with loadMovie() or (in this case) with loadClip()...

scotty(-:

Tillie
12-30-2006, 08:45 AM
loading is successfull! i'm loading .swf 5 times to present the buttons! they have opening, over and out state! now the opening i see animated as it should be but it doesnt play the over nor the out state!
after i load them i'm putting text over them from .xml -maybe that's why they wont react?? but how do i manage animated .swf button then?


@RileyBoy.....thanks for the advice...i do know how to do that but then it wouldnt be easy to manage and update would it? I'm trying to leave only the necessary MCs in .fla:cubs:

fr-ode
01-01-2007, 02:27 PM
hi! it's rather simple.

in the fourth frame, after the onPress stuff, add:

target_mc.onRollOver = function() {
this.gotoAndPlay(2);
}
target_mc.onRollOut = function() {
this.play();
}

And set up your button swf with two frames and add stop(); to both of them.

fr-ode
01-01-2007, 02:29 PM
and don't make your buttons actual buttons, just make two frames in a new project and export the swf.

Tillie
01-01-2007, 05:50 PM
THANK YOU!!! that is what i needed.

yesterday I've already figured it out myself...all the time i was adding .swf buttons with all the states and commands:crazy:
anyway it's working now...though it has 3 frames for each state before the stop()

NEW QUESTION: menu works very slow. it works fine but if i move the cursor faster it doesnt run the comands as it should....
any cure???

many thanks

and happy new year

fr-ode
01-03-2007, 06:52 PM
I'm really busy at work nowadays Tillie. 14 hours today. Could you post your files? I'll take a look at it when I have some spare time.

:)