homepage Welcome to WebmasterWorld Guest from 54.197.130.16
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

    
Sliding Interface - Using Links from an XML file Problem
my poor knowledge of flash is driving me insane!
HansStrangeways




msg:3597275
 10:05 am on Mar 11, 2008 (gmt 0)

Hi All,

Working on a new site for the company i've recently started working for... fairly new to flash but wanted to try this sliding interface for the graphic banner at the top of the page...

have a look here at an early version of the site - sliding graphic interface at the top with coloured rollover buttons (a lot of work still to do! feel free to post constructive criticism)

(link removed - doh - sorry just seen the rules about posting links... anyway)

The Problem:

I am pulling in a 'heading' 'text' and 'image' into the sliding graphic interface from the following xml file... (there are 4 different xml files for 4 different slides)

<?xml version="1.0" encoding="iso-8859-1"?>
<content>
<dialogue>
<heading>Interested in selling our health plans?</heading>
<text>Click here to learn more...</text>
<img>home_window/intSmall.jpg</img>
</dialogue>
</content>

I want to add a link to the xml that would be specific to each instance of the window...

eg

<link>contact-us/index.asp</link>

But my limited knowledge of flash means I have no idea how to pull the link through from the xml file to use in the flash...

Perhaps I need link text to pull as well

eg

<link-text>click here to contact us</link-text>

Here is the function that pulls in the img, heading and txt

public function onComplete(event:Event):void {
var loader:URLLoader = event.target as URLLoader;
if (loader != null) {
externalXML = new XML(loader.data);
mover_mc.heading_txt.htmlText = externalXML.dialogue[0].heading;
mover_mc.myText_txt.htmlText = externalXML.dialogue[0].text;
var url:URLRequest = new URLRequest(externalXML.dialogue[0].img);
myLoader.load(url);
} else {
trace("loader is not a URLLoader!");
}

Can anyone help me on how to pull in the link from the xml and use it to navigate to a different page on the site

Thanks very much

Hans

[edited by: HansStrangeways at 10:11 am (utc) on Mar. 11, 2008]

 

alias




msg:3598265
 9:44 am on Mar 12, 2008 (gmt 0)

if I understand you correctly.. you just use the value of the <link> from XML as the value for the getURL(target) function. just as you get the values for the heading and for the text.

or did I miss something?

HansStrangeways




msg:3598289
 10:54 am on Mar 12, 2008 (gmt 0)

thanks... i'll have a go

It's just I did this bit of flash following a tutorial because I'm brand new to all this flash stuff - so essentially my understanding of it isn't great to say the least

i'm still at the stage of syntax confusing the hell out of me

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved