PDA

View Full Version : [FMX] calling url from xml file



amiller
November 29th, 2004, 09:46 PM
Hello everyone, my first post. I have been searching forums and tutorials for 3 weeks now and I'm going mad! What I'm trying to do is to make a simple link in flash that is called from my xml file.

Here is a link to my project:
http://www.miuz01.com/xml_url/interactive_gallery.html

Here are the files:
http://www.miuz01.com/xml_url/links.html

I have wracked my brain for weeks trying to figure this out on my own :( I know that it has to do with the for loop and calling a new link for each project, that is what has me confused. Maybe there is an easier way to do this. Thanks anyone who can help out!

RvGaTe
November 30th, 2004, 05:49 AM
i can see the other fields are working, sooo:

why dont you give each field group a number... so you get something like:


_root.myURL_1.heading = "blabla"
_root.myURL_1.desc = "blabla"
_root.myURL_1.image = "blabla"
_root.myURL_1.url = "blabla"

then, when you include the View Project button inside this group aswel, you can easily refer to the correct urls and namings


_root.myURL_1.viewButton.onRelease = function(){
ShowProject(_parent.heading, _parent.desc, _parent.image, _parent.url)
}

then, whenever you click on the view project button, it will call the function ShowProject, and there you can easily assign the right actionscript with the right information... ?

something like that?

amiller
November 30th, 2004, 07:57 PM
I wish I could place the "view project" button inside the group, but I can't because in order for the group to slide, there is an exact pixel width of 245. If I place the button inside, then the slider will be out of place. I need to code the button all by itself and still reference the same xml file. Frustrating!!! Can you think of a way to do this?


i can see the other fields are working, sooo:

why dont you give each field group a number... so you get something like:


_root.myURL_1.heading = "blabla"
_root.myURL_1.desc = "blabla"
_root.myURL_1.image = "blabla"
_root.myURL_1.url = "blabla"

then, when you include the View Project button inside this group aswel, you can easily refer to the correct urls and namings


_root.myURL_1.viewButton.onRelease = function(){
ShowProject(_parent.heading, _parent.desc, _parent.image, _parent.url)
}

then, whenever you click on the view project button, it will call the function ShowProject, and there you can easily assign the right actionscript with the right information... ?

something like that?

amiller
November 30th, 2004, 09:45 PM
I am trying here... this is what I am trying now. the button that launches the url for the project has the instance name "launch_btn". I am trying to make the button have a new url each time it is pressed for the corresponding project. Flash is giving me no errors whats going on here?:

launch_btn.url = url;
url = allGalleryData[i].firstChild.nextSibling.nextSibling.nextSibling.fi rstChild;
thisLink = new Link(url);

links.push(thisLink);

delete thisLink;
launch_btn.onPress = function(links) {
"<a href='" + links[i].url + "'target='_blank'></a><br>";
}

the updated files are available at:
http://www.miuz01.com/xml_url/links.html

my portfolio defense is next thursday. I would hate to have to go in and manually create my flash site for EACH project! XML seems so much simpler once you make it work :(