# Xml Variable

**URL:** https://forum.kirupa.com/t/xml-variable/42058
**Category:** flash
**Created:** [February 4, 2004, 5:41pm UTC](https://forum.kirupa.com/t/xml-variable/42058 "2004-02-04T17:41:06Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![thesignx](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@thesignx](https://forum.kirupa.com/u/thesignx)
#### Post date: [February 4, 2004, 5:41pm UTC](https://forum.kirupa.com/t/xml-variable/42058/1 "2004-02-04T17:41:06Z")

</div>

Hi, there all

I have a script wich loads XML structured text, and one line or tag has an URL-hyperlink wich works fine… BUT I find out that instead of going to an URL when clicking this active-xml-text I need a gotoAndStop() … IS IT POSIBLE?

thanks all of you!

[felipe@mexmags.com](mailto:felipe@mexmags.com)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 4, 2004, 6:05pm UTC](https://forum.kirupa.com/t/xml-variable/42058/2 "2004-02-04T18:05:33Z")

</div>

well, depending on how you are setting up xml doc.

````php
<myNode gAP=10 />
```php

do something like that and when you parse:

````

myframe = Number(myxml.childNodes[nodeNum].attributes.gAP);  
gotoAndPlay(myframe);

```auto

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 4, 2004, 8:29pm UTC](https://forum.kirupa.com/t/xml-variable/42058/3 "2004-02-04T20:29:54Z")

</div>

SORRY I SEND YOU A (PM)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 4, 2004, 8:41pm UTC](https://forum.kirupa.com/t/xml-variable/42058/4 "2004-02-04T20:41:08Z")

</div>

Thanks for all your help!

I successfuly generate variables with attributes, but now the text is no longer hyperlink active (mouse does not react to it) now that I use attributes to pass variables how do I say to flash that if you click that line gotoAndStop…bla…bla…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 4, 2004, 10:27pm UTC](https://forum.kirupa.com/t/xml-variable/42058/5 "2004-02-04T22:27:52Z")

</div>

Yeah, it’s possible. You can use the [font=courier new]asfunction[/font] protocol to call the [font=courier new]gotoAndStop()[/font] function.

That would be something along these lines:

```php
<parentnode>
<childnode>Frame 2? <a href="asfunction:gotoAndStop,2">Go!</a></childnode>
</parentnode>

```

```auto
var my_xml = new XML();
my_xml.onLoad = function(success) {
if (success) {
my_txt.html = true;
my_txt.htmlText = this.firstChild.firstChild.childNodes;
}
};
my_xml.load("file.xml");

```

And run a search for “asfunction” in the forum, you should find some threads about it. 😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 4, 2004, 10:53pm UTC](https://forum.kirupa.com/t/xml-variable/42058/6 "2004-02-04T22:53:57Z")

</div>

Kode… gracias compadre!

I will try it on later, will contact you tolet you know!

Im from Puerto Vallarta, Mexico

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 4, 2004, 11:06pm UTC](https://forum.kirupa.com/t/xml-variable/42058/7 "2004-02-04T23:06:00Z")

</div>

Ok! No tiene pierde, pero si no te sale nada más me avisas y veremos que hacer. 😛

…Y por cierto, yo soy de Guanajuato. 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 6, 2004, 3:59pm UTC](https://forum.kirupa.com/t/xml-variable/42058/8 "2004-02-06T15:59:12Z")

</div>

que onda kode…

It works fine, but now i have a nother question: instead of using a number or label to go to; how can i use a global variable wich contains the frame I want it to go to. (the value of this global comes from an attribute from the XML, I test it and it shows the exact value)

Gracias!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 6, 2004, 4:24pm UTC](https://forum.kirupa.com/t/xml-variable/42058/9 "2004-02-06T16:24:18Z")

</div>

I GOT IT!!! …THANKS KODE!!!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 6, 2004, 6:32pm UTC](https://forum.kirupa.com/t/xml-variable/42058/10 "2004-02-06T18:32:03Z")

</div>

…You’re welcome, signx. 😉

It wasn’t that hard after all, was it? 😛
