views:

103

answers:

1

Hello, I have created a flash map of the uk which is splti into regions, each region is a button that is fully visible when not rolled on and and fully transluscent when rolled over(to show the same region in a different color). What I need now is for when the button is rolled over I need it show the region name, I have an array of the region names and I was hoping it would be possible to write the AS in seperate file and then link it to the SWF. Is this possible and how would I write the function?

Thanks

Sico87

+1  A: 

Ok. You don't need a class. The regions are static shapes. Put theirs names under them and in animation change alpha to 0 to show name of region and background color.

If you like to use class:

  1. If you build scene from code: create basic class for button behaviour (class extending Sprite with events) and extend it with code of region.

  2. If you build scene in flash: Create class extending Sprite with mouse events handlers. On MouseEvent.ROLL_OVER and Mouse Event.ROLL_OUT animate it property or childrens properties. Use getChildByName("Name in stage")

At the end in library select "export for ActionScript". In "Basic class" write your class name.

Konrad
It's a basic thing - you find milions of tutorials showing how to do it :)
Konrad