Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Creating a dynamic expo map in Flash

Posted on 2004-09-09
10
Medium Priority
?
474 Views
Last Modified: 2006-11-17
I'm a complete noob at Flash, so please be nice.

I want to create a map that when you rollover a booth on an expo map, the company that bought that booth displays in a popup or something.  Maybe have the booth highilght as well.

I have the map of all the booths with #'s, and another file in Excel that has the Company name and the booth #'s.

How should I begin?

I figure I'll have to manually go through the map and mark each booth as a number, but how do I do that?  Do I make each one a separate movie clip?

Any help would be appreciated?
0
Comment
Question by:cbestal
  • 5
  • 4
10 Comments
 
LVL 10

Expert Comment

by:muso120999
ID: 12022019
If you want the booths to highlight, you would need to create them as buttons, otherwise you could have invisible movieclips (or buttons again) hovering over the booth image.

For a rollOver effect you can either put the rollover graphic on the "over" button state, or create a separate movieclip, with a frame for each of the booth pop-ups.

If you are going to use a separate movieclip, then you will need the code "stop();" in the first frame, and "on(rollOver){_root.rollover_mc.gotoAndStop(3);}" on your buttons - where rollover_mc is the name of your movieclip with the highlights, and 3 is the frame number of the pop-up.  Again for this option you may need the code "on(rollOut){_root.rollover_mc.gotoAndStop(1);}", where frame 1 has no pop-up visible so the pop-ups disappear when rolling back out.

Obviously the button "over" state is the easier option, as it requires no code!
0
 
LVL 39

Accepted Solution

by:
blue-genie earned 1200 total points
ID: 12024971
this is what you want right?
simple rollover buttons, that show a company name, pulled out from excel?
I've done a quick mock up and it works out fine.

if that is what you want to achieve, here's what I've done.
First of all, your xls must be in csv format.

then, i have a movieclip on my stage that loads the csv, formats it in the format i want, and i set a variable per excel entry.

then i have a dynamci text field on the stage to receive the data.

i have the movieclips with the rollover states to which all call the function which retreives its # and pairs it to the variable i've set and displays the appropriate data in the dynamic textbox.


0
 

Author Comment

by:cbestal
ID: 12029833
blue-genie, yes, that's exactly what I want to do.

a couple quesions:
1. how do you get a movie clip to automatically load a csv?

2. how does each movie clip reference it's own # and then lookup it's associated value?

Thanks
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 39

Expert Comment

by:blue-genie
ID: 12041792
code in AS1.

1. how do you get a movie clip to automatically load a csv?

to load a csv, you simply use LoadVars as per any other data source.
all the loading is in the black box on the top left - that loads the data.

2. how does each movie clip reference it's own # and then lookup it's associated value?

I've created a function that tells the rollovers what to load based on its instance name  - you'll notice its a generic function.

go grab this file. //remember i created the excel/csv called companies.csv - so either rename your csv file, or change the code.

http://www.geocities.com/bluegenie_sa/ee/loadText.zip
let me know if you need some explanations.

blu :-)



0
 

Author Comment

by:cbestal
ID: 12046879
Ok, im looking into how to use LoadVars in my movie clip.

I'd be interested in the function to get the instance name, I tried your link, but it's broken.

Thanks.
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 12052837
hi, sorry, go have a look at the link again, i've re-uploaded it - for some odd reason it wasn't there.

must have been friday fever.
sorry.
blu.
0
 

Author Comment

by:cbestal
ID: 12055718
I have found out how to obtain my MC instance name, and supply that to a dynamic text box upon MC rollover.

Right now i have a large image, with 100 movie clip instances over it, each with a different instance name.  When you rollover any MC it display it's instance name in a dynamic text box.

My problem is that I can't load the CSV file and use the values that correspond to the instance name to give to the text box.

I was able to download your zip, but I couldn't open it, as I only have Flash MX.  Could you post code that shows how to do this, and where in my .fla to put it.  

thanks.
0
 

Author Comment

by:cbestal
ID: 12059662
Ok, I found out how to parse the CSV file into an array using this link: http://www.actionscript.org/forums/showthread.php3?t=30052

So I have almost everything woring, except some of my data is in the format

ID , Name
94, Booth 1
92, Booth 2
88-92, Booth 3

Is it possible to have 2 movie clips play using actionscript?  by calling _root.88.gotoAndStop() or something?
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 12061973
you can have as many mcs play as you want.
0
 

Author Comment

by:cbestal
ID: 12180920
Thanks for the help.  I eventually got somethign working that suited my needs.  I have to manually update the movie clips whenever there are changes to the booth ID's similar to my last comment (when two numbers for the same booth),, but  at least it works.

Thanks.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question