URGENT HELP: Roll-overs using actionscript

Hi:

I’ve created a U.S.Map with roll-overs for each state. What i want is that when you roll-ver each state, you can see a photo + some text appear in the same scene. The idea is that, eachstate has a different photo+text that appears when you roll over it. How do I do this using actionscript?

I have attached a raw .fla file I have started, in order to see what I’m talking about. Please click on “HIV” button to view the roll-overs already created. All I need is to add photos to each U.S. state now??

PLEASE HELP, THIS IS URGENT!

I can’t find your attached fla, but I think I get what you mean.

this.yourStateMc.onRollOver = function(){   /*replace yourStateMc with the the instance name you gave your mc*/
attachMovie("newphoto","newphoto", this.getNextHighestDepth());/* replace newphoto with your phot name*/
newphoto._x= 150;//put in your own coordinates.
newphoto._y=150;
}


is that what you are looking for?
I’m also new to actionscript and didn’t test that since I can’t see your file:)

[QUOTE=skellykitten;1984607]I can’t find your attached fla, but I think I get what you mean.

this.yourStateMc.onRollOver = function(){   /*replace yourStateMc with the the instance name you gave your mc*/
attachMovie("newphoto","newphoto", this.getNextHighestDepth());/* replace newphoto with your phot name*/
newphoto._x= 150;//put in your own coordinates.
newphoto._y=150;
}


is that what you are looking for?
I’m also new to actionscript and didn’t test that since I can’t see your file:)[/QUOTE]
Here is the code I changed it to…It still says error in code?? I am attaching myflash file. Please help me if you can! Everyting i need is on the “HIV BUTTON” PAGE.

this.Batterman.onRollOver = function(){
attachMovie(“batterman_photo.jpg”,“batterman_photo.jpg”, this.getNextHighestDepth());
newphoto._x= 150;
newphoto._y=150;
}

You’re fla still isn’t attached, at least not that I can see. Make sure after you hit browse and select it that you press upload, then post your message

I should have asked this too-
[LIST]
[] first is your “batterman” object a button or a movieclip?
[
]are you loading your photo externally or from the library?
[*]did you drag it onto the screen or use attachmovie on “batterman”[/LIST]If you are loading (the photo) it externally it’s a different script, you have to create an empty movie clip to load it into. You can do that by pressing ctrl+f8 and then naming it. Thne you can drag it on the stage where you want it, or you can creat it dynamically.
I’ll play around and see what I can figure out :slight_smile:

Me again-
I used this and it worked- I’m assuming you are loading the jpgs externally so here are some things you need to make sure of first:

  1. make sure that you have your fla and your jpgs saved in the same file folder ont your computer
    2 when you upload them to the internet (if you are going to) they also have to be in the same folder/directory

//creates an empty movie clip to load your jpgs into
this.createEmptyMovieClip("cont_1", this.getNextHighestDepth());

batterman.onRollOver = function(){
//load to emptycontainer
 cont_1.loadMovie("batterman_photo.jpg");
 cont_1._x=225;
 cont_1._y=255;
};
// this removes the clip on rollout- just delete it if you don't want that to happen.
batterman.onRollOut = function(){
	cont_1.unloadMovie("batterman_photo.jpg");
}

One thing with code written this way is that you don’t attach it directly to the movieclip. On your main timeline, you need to make another layer, name it actions and lock it so you don’t accidently put any movieclips or buttons on it. Then place the actionscript on the first frame of that layer.
I hope this helped:)

HERE IS THE FLASH FILE. PLZ TEST!!!

[quote=skellykitten;1984607]I can’t find your attached fla, but I think I get what you mean.

 ActionScript Code:
 [FONT=Courier New][LEFT][COLOR=#0000ff]this[/COLOR].[COLOR=#000080]yourStateMc[/COLOR].[COLOR=#0000ff]onRollOver[/COLOR] = [COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]   [COLOR=#808080]*/*replace yourStateMc with the the instance name you gave your mc*/*[/COLOR]

[COLOR=#0000ff]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]“newphoto”[/COLOR],[COLOR=#ff0000]“newphoto”[/COLOR], [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];[COLOR=#808080]/ replace newphoto with your phot name*/[/COLOR]
newphoto.[COLOR=#0000ff]_x[/COLOR]= [COLOR=#000080]150[/COLOR];[COLOR=#808080]
//put in your own coordinates.*[/COLOR]
newphoto.[COLOR=#0000ff]_y[/COLOR]=[COLOR=#000080]150[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]

is that what you are looking for?
I’m also new to actionscript and didn’t test that since I can’t see your file:)[/quote]

HERE IS THE FLASH FILE. PLZ TEST!!! COULD YOU PLEASE TEST THE CODE YOU WROTE ON IT & SEND IT BACK TO ME? IT STILL SHOWING ME ERRORS :hurt:

ALSO, YOU MAY NEED TO GROUP EVERYTHING AND INCREASE THE SIZE, JUST SO U CAN SEE THE GRAPHICS. I HAD TOR EDUCE THE FILE SIZE AS THERE IS A SIZE LIMIT ON YOUR WEBSITE.

THANK YOU AGAIN FOR DOING THIS. I AM LOOKING FORWARD TO YOUR REPLY AS YOUARE SO CONCISE & ARTICULATE. TRULY ENJOYING THIS! U GUYS ARE THE BEST!

THANKS!!!