PDA

View Full Version : Flash buttons


losse
06-28-2007, 05:56 PM
Hi there
I'm creating a header on a site out of flash that will sit on a php page. The header has navigation buttons (like home, contact us, about us...)...

I've created "on mouse over" actions before but I would to know how I can change the look of the button when the user is on that page...

For example, when they come to the homepage, all buttons have a black background, but when they go to the contact us page all buttons have a black background and the contact us button has a red background... Same concept for the other buttons...

Thanks!

_Aerospace_Eng_
06-28-2007, 06:17 PM
Well you are using php so that solves half your issue. Pass a variable to the swf by using something like
flash.swf?id=1
Then the swf would read the query by using this.id and then you can change the appearance of the button according to the id.

losse
06-28-2007, 06:25 PM
whoa! way over my head... Can you elaborate a little?

So I'd just create on the php something like:


<?php
flash.swf?id=1
?>

and then on the flash side, how would it read that variable?

_Aerospace_Eng_
06-28-2007, 06:28 PM
Umm no.
<object type="application/x-shockwave-flash" data="flash.swf?id=1" width="100" height="20">
<param name="movie" value="flash.swf?id=1">
</object>
Then have flash read the variable by using
var current = this.id;

losse
06-28-2007, 06:33 PM
ok it's starting to make sense...

So how do I label the id's in flash? do I do it on the button level ?

_Aerospace_Eng_
06-28-2007, 07:19 PM
Are your buttons movie clips or normal buttons with an up, down, over, and hit state?