Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,277 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,186 people online right now. Registration is fast and FREE... Join Now!




Loading External Text into an Image Map

2 Pages V  1 2 >  
Reply to this topicStart new topic

Loading External Text into an Image Map

jli112
post 30 Sep, 2008 - 11:21 AM
Post #1


New D.I.C Head

*
Joined: 29 Sep, 2008
Posts: 18


My Contributions


A little background on what I'm trying to do. I am making an campus image map, when the mouse is rolled over one of the letters, a little box should come up to show a little snipped about the building and then something that can be clicked to go to the web page associated with that building.

This page is what I had/have so far Campus Map. Now, what is going on there is, those things that follow the marker around are images and the letters themselves are hotspots. I need to make it better.

Here is the code I'm putting in the button:

CODE

on (rollOver) {
    loadText = new LoadVars();
    loadText.load("engtech.txt");
    loadText.onLoad = function(success) {
        if (success) {
            // trace (success);
            engtech.html = true;
            engtech.htmlText = this.engetch;
        }
    };
}


My problem is that I don't know if I'm putting it in the right place, or if I'm asking too much of my button (a rollover and a click - but its on a different layer). Eventually if I get the rollover to work and have the external text show up (and show as html) I would take the onclick off and just have the text link inside the box that would show for each building. When I test the movie, I don't see anything come up. I tried it another way, but I never saved that old code, and just had an empty text box. I'm so confused.
User is offlineProfile CardPM

Go to the top of the page

DilutedImage
post 1 Oct, 2008 - 10:05 AM
Post #2


D.I.C Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 642



Thanked 6 times

Dream Kudos: 25
My Contributions


I'll look into this later this afternoon. I've got some ideas.
User is offlineProfile CardPM

Go to the top of the page

jli112
post 1 Oct, 2008 - 10:27 AM
Post #3


New D.I.C Head

*
Joined: 29 Sep, 2008
Posts: 18


My Contributions


Thats awesome, thanks so much. Any help you can give me is greatly appreciated. smile.gif
User is offlineProfile CardPM

Go to the top of the page

DilutedImage
post 4 Oct, 2008 - 02:34 PM
Post #4


D.I.C Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 642



Thanked 6 times

Dream Kudos: 25
My Contributions


Sorry for the delay; been busy. I'm playing with this now.

EDIT: Can you attach the source file for me to play with? I could write something that'll work for you, but I can't correct your own attempt without seeing it. I need to know how/where "engtech" has been used (you've assigned it as it's own htmlText, which should have thrown an error).

This post has been edited by DilutedImage: 4 Oct, 2008 - 02:46 PM
User is offlineProfile CardPM

Go to the top of the page

jli112
post 6 Oct, 2008 - 08:00 AM
Post #5


New D.I.C Head

*
Joined: 29 Sep, 2008
Posts: 18


My Contributions


Sure! I zipped up the files I was working on. campusmap3a includes the fla and the text file that I'm using. This is the one that I copied the code out of to show. I included the text file in case there is something I forgot to include in it that is causing it not to work. It is the one that will most likely become the final product. I also zipped campusmap3, which just shows the steps before 3a, before I took the images and marker out, just to show progression. Thank you again for looking at this, I've been working on it for months.

EDIT: It helps if I upload the zips..Attached File  campusmap3a.zip ( 60.45k ) Number of downloads: 13
Attached File  campusmap3.zip ( 888.41k ) Number of downloads: 11


This post has been edited by jli112: 6 Oct, 2008 - 08:12 AM
User is offlineProfile CardPM

Go to the top of the page

DilutedImage
post 6 Oct, 2008 - 05:43 PM
Post #6


D.I.C Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 642



Thanked 6 times

Dream Kudos: 25
My Contributions


EDIT: campusmap3a includes the swf and txt file. The FLA would be most helpful. biggrin.gif

EDIT2: campusmap3.fla has the code pasted above, so I'll just work off that one.

This post has been edited by DilutedImage: 6 Oct, 2008 - 05:53 PM
User is offlineProfile CardPM

Go to the top of the page

jli112
post 6 Oct, 2008 - 07:44 PM
Post #7


New D.I.C Head

*
Joined: 29 Sep, 2008
Posts: 18


My Contributions


QUOTE(DilutedImage @ 6 Oct, 2008 - 06:43 PM) *

EDIT: campusmap3a includes the swf and txt file. The FLA would be most helpful. biggrin.gif

EDIT2: campusmap3.fla has the code pasted above, so I'll just work off that one.



Oh wow I'm sorry I must have zipped the wrong file. If you need the other one I can zip that as well. Both files should have some part of the convoluted code I tried to write. biggrin.gif I thought I included the fla. sorry bout that.
User is offlineProfile CardPM

Go to the top of the page

DilutedImage
post 6 Oct, 2008 - 11:54 PM
Post #8


D.I.C Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 642



Thanked 6 times

Dream Kudos: 25
My Contributions


No problem. I scrapped most of it anyways. biggrin.gif

Attached is my revision. I've ditched the LoadVars approach, in favor of XML. I'm lazy though, so only buildings A-C have been typed out. Be sure to keep the CDATA tags in there, so your HTML is preserved.

The code is short, but there's a lot going on, so just post up if you have any questions about it.


EDIT: I removed the attachment. A Flash 8 version has been attached a couple posts down.

This post has been edited by DilutedImage: 9 Oct, 2008 - 10:08 AM
User is offlineProfile CardPM

Go to the top of the page

jli112
post 8 Oct, 2008 - 09:56 AM
Post #9


New D.I.C Head

*
Joined: 29 Sep, 2008
Posts: 18


My Contributions


You are a lifesaver! I will look at it this afternoon and work on finishing it. Thanks so much!
User is offlineProfile CardPM

Go to the top of the page

DilutedImage
post 8 Oct, 2008 - 11:30 AM
Post #10


D.I.C Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 642



Thanked 6 times

Dream Kudos: 25
My Contributions


Happy to help. smile.gif
User is offlineProfile CardPM

Go to the top of the page

jli112
post 9 Oct, 2008 - 08:35 AM
Post #11


New D.I.C Head

*
Joined: 29 Sep, 2008
Posts: 18


My Contributions


I have the most basic of stupid questions... um I forgot to mention which version of flash I had been using (Flash 8). When I try to open the file it says unexpected file type or something like that. I am looking for the Flash CS3 trial on adobe's site, but can't seem to find it. Is there a way to save it so its compliant with flash 8?
User is offlineProfile CardPM

Go to the top of the page

DilutedImage
post 9 Oct, 2008 - 10:05 AM
Post #12


D.I.C Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 642



Thanked 6 times

Dream Kudos: 25
My Contributions


Whoops! I noticed that when I opened it, and forgot about it when I saved it back out. Sorry about that. I've attached a Flash 8 version.


Attached File(s)
Attached File  campusmap3_x.zip ( 1.59mb ) Number of downloads: 13
User is offlineProfile CardPM

Go to the top of the page

2 Pages V  1 2 >
Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 12:38AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month