Go Back   kirupaForum > Flash > ActionScript 1.0/2.0

Reply
 
Thread Tools Display Modes
Old 11-23-2009, 06:35 PM   #1
belthazor311
Registered User
[Flash CS3]Need help with XML links.

So what I am trying to do is have icons that are loaded from an xml document also contain urls to go to different pages when they are clicked on. Here's my code so far.

XML FILE
<icons>

<icon image="images/icon1.png" tooltip="Information concerning different degree programs and career paths." url="degreeMatters.html" />

<icon image="images/icon2.png" tooltip="Stories from students concerning their college experience." url="studentsTale.html" />

<icon image="images/icon3.png" tooltip="Tips and tricks for building resume that will get you noticed." url="yourResume.html" />

<icon image="images/icon5.png" tooltip="Our collection of video and audio stories, as well as blogs." url="mediaArchives.html" />

<icon image="images/icon6.png" tooltip="Helpful links to outside sources. Tell em EvoU sent ya!" url="links.html" />

<icon image="images/icon4.png" tooltip="Info about the members of EvoU's team and a way to contact us." url="contact.html" />

</icons>

var numOfItems:Number;
var radiusX:Number = 400;
var radiusY:Number = 250;
var centerX:Number = Stage.width / 2;
var centerY:Number = Stage.height / 2;
var speed:Number = 0.01;
var perspective:Number = 130;
var home:MovieClip = this;
theText._alpha = 0;

var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;

var xml:XML = new XML();
xml.ignoreWhite = true;

xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
{
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.url= nodes[i].attributes.url;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.r.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
}

function over()
{

home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;

}

function out()
{
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
}

function released()
{
//NEED HELP HERE!
}
belthazor311 is offline   Reply With Quote

Sponsored Links (Guests Only) - Register | Need Help?
 

Old 11-30-2009, 10:21 PM   #2
belthazor311
Registered User
Some one help please!
belthazor311 is offline   Reply With Quote
Old 11-30-2009, 11:18 PM   #3
MaToMaStEr
Registered User
 
MaToMaStEr's Avatar
Location Concepción, Chile

Posts 97
What about:

t.onRelease = function(){
getURL(this.url,"_blank");
}

__________________

MaToMaStEr is offline   Reply With Quote
Old 12-04-2009, 12:58 AM   #4
belthazor311
Registered User
I'm still getting a page cannot be found when it opens in a new window.
"Firefox can't find the file at /H|/EvoU/undefined."

I tried changing your suggested code to
t.icon.onRelease = function() {
getURL(this.url, "_blank");
};

instead of t.onRelease since the other functions use t.icon.

It seems that the problem is that the getURL command isn't getting the string content of t.content.

Any other suggestions?
belthazor311 is offline   Reply With Quote
Old 12-04-2009, 04:04 AM   #5
belthazor311
Registered User
I figured it out!

function released() {
getURL(this._parent.content, "_blank");
}

Works like a charm!
belthazor311 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:18 PM.

SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
Creative web apps. Make your own free flash banners and photo slideshows.
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.

Flash Transition Effects

Flash Effect Tutorials

Digicrafts Components
Flash effects. Art without coding. Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com
Streamsolutions Content Delivery Networks Flipping Book - page flip flash component.
Flash-Gallery.com - Get your flash photo gallery (flash component or swf gallery Learn how to advertise on kirupa.com
 

cdn
content delivery network (cdn)

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Copyright 2010 - kirupa.com Copyright 2010 - kirupa.com