Tuesday, March 30, 2010

quick movements mess up my variables

I have an interactive map with multiple hotspots on it.?When the user mouses over a hotspot (Button) a value is assigned to a variable (country).?The actionscript (AS2) is also told to go to a frame performing a close sequence on the currently open animation.

so if userA has moused over Brazil the following AS is on the Brazil button:

on(rollOver) {
?if(country != 'brazil') {
?gotoAndPlay(country+'-close');?//goes to closing sequence for currently selected country
?var country = 'brazil';
?}
}

once the timeline hits the last frame of the close sequence the following AS is on the last frame of the sequence:

gotoAndPlay(country);

(each country has a frame labeled for it on the timeline with an opening/hold/closing frame sequence.)

my problem arises if a user mouses over one country and in the middle of the 3 frame opening/closing sequence they quickly mouse over another country, it seems like the variables get 'screwed up.'?the variable appears to lag, so when the user mouses over countryA, then countryB to countryC very quickly, countryB will be highighted and remain highlighted until i mouse over countryA again (and then it will go to countryC).?[i know this is a bit confusing, but hopefully it makes sense to someone else]

does anyone have any suggestions on how to eliminate this issue??i only have 5 regions, and the file size of the swf is small (160kB), so I dont understand the lagging and breaking.

thanks in advance for any help.

(i've attached the exported swf file so you can see what i'm rambling about)

No comments:

Post a Comment