-
Instance Name on Rollover?
Greetings,
I am working on a project where I've created a button/symbol that will be used over a hundred times to indicate various golf courses in the area. On a rollover I'd like to have the instance name (the golf course's name) of that particular interation of the symbol to display next to it. Is there anyway to do this without having to create a new symbol for each golf course?
Any help would be greatly appreciated.
thanx!
c3_
-
How should I know!?
Hi
Sure,
Just make each golf course a movie clip like it sounds like you have done. Give each one a unique instance name. Within that MC, place a dynamic text box.
Then when you rollover the golf course, have an action like this:
code:
on (rollover) {
_root.clipName.text = "course name";
}
Hope this helps, if ou have any problems, let me know.
[something cool goes here]
-
Although if you have hundreds of the little blighters, and they all have to be manually placed on a map, you may be better off to use the component definition feature of the library.
Last edited by AlsoGaiusCoffey; 07-11-2008 at 07:32 AM.
-
Hey! AGC! Aren't you running in Greece?
Or did you fail the drug test?
-
Biff: Thank you for your help. The symbol was a button not a Movie Clip initially but I changed that based on your comments. The text field now flashes - alternating between the version w/o the textbox and the Rollover version with the text box. The text box is not displaying anything eventhough the instance name has been entered.
Here's the URL to what I've got:
http://ulanji.com/clients/c3/golf_ex.fla
What have I done wrong?
AlsoGaiusCoffey: I appreciate your example but the is WAY over my head. Its essentially what I'd like but I have no clue how you got to where that is.
thanks for all your help!
c3_
-
Or did you fail the drug test?
Yup, failed it alright. Messed up the practical when I took the wrong pile. Such a shame really, everyone was so friendly and even Queen Zelda of the planet Zarpon had come to watch.
(Although, when she transmogrified into a 15 foot fire-breathing lizard with venomous fangs I nearly managed to run as fast as those who had passed the test.)
-
When you change to a MC from a button, you need to put a stop action in the first frame.
The attached is a bit simpler and based on what you have, check the first frame of the movie clip to see what I have done with the actions. Check the variable field in properties for the textfield to show how I have referenced it.
Last edited by AlsoGaiusCoffey; 07-11-2008 at 07:32 AM.
-
Awesome! Works great. Thank you so much.
I appreciate your help.
c3_
-
One More thing :)
Now that I have that working I've run into another problem. I am trying to make each instance of the Movie Clip clickable to a URL for the site. Here's the code I am using:
onClipEvent (mouseDown) {
getURL(heron_point.html);
}
The problem I am running into is that I have set this Action on several different instances of the Movie Clip. Each has a different URL plugged in but when I test it it tries to send me to ALL of them regardless of which I press. Is there any way to fix this?
I appreciate all the help.
thanks,
c3_
-
How should I know!?
When you created your (buttons now movie clips) make sure that you give them a new name. If you just have 1 master copy, and change it, it will change on all of the movie clips.
[something cool goes here]
-
Biff: Are you referring to the names of the individual instances? Those are all different. Here's the code I have added to to the Action of the movie clips:
onClipEvent (mouseDown) {
getURL(_name + ".html");
}
Another problem I am having is that this will trigger if I click *anywhere* not just the particular symbol as I would like. This is really bad because other sections of the map are suppose to be clickable to advance to other scenes.
Here's the URL to what I have thus far:
http://ulanji.com/clients/c3/mc_test.html
The next step is to smehow eliminate the spaces and capitalization for the URLs. I appreciate all your help. This is very frustrating for me.
c3_
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|