# Flash/XML - help with getURL function

**URL:** <https://forum.kirupa.com/t/flash-xml-help-with-geturl-function/64413>\
**Category:** programming\
**Created:** [September 16, 2004, 12:16am UTC](https://forum.kirupa.com/t/flash-xml-help-with-geturl-function/64413 "2004-09-16T00:16:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![katman](https://avatars.discourse-cdn.com/v4/letter/k/71c47a/32.png) [@katman](https://forum.kirupa.com/u/katman)\
**Post date:** [September 16, 2004, 12:16am UTC](https://forum.kirupa.com/t/flash-xml-help-with-geturl-function/64413/1 "2004-09-16T00:16:25Z")

</div>

Hi…

First of all, I hope I’m posting in the right forum =)

I’ve messed around with XML+FLASH menu systems (downloaded from various Flash resource sites) on a novice level . As in, I know how to modify the XML file to have the content I want and where to rename the XML file in the FLA if need be. But I’ve never had to actually manually modify any functions within the FLA before. I’m really green when it comes down to diggin’ within the Flash coding.

Anywho, I came upon this really nice horizontal/glide menu from a way talented flash guru who was nice enough to share his source files with me…

The files are located here (btw, its an MX 2004 FLA file):  
[http://www.ff-squad.com/dev/horzmenu](http://www.ff-squad.com/dev/horzmenu)

The problem I’ve run into with it, is that any hyperlinks setup within this menu will only open windows on a ‘parent’ level, which I don’t want. With other Flash+XML menu systems like this, usually the authors allow you to change the targeting to whatever you wish easily through the XML file (ie. \_blank, mainFrame, etc) and that’s what I wish to have with this menu – Customizeable targeting through the XML file for any hyperlink.

I didn’t wanna bother the Author of this menu too much, but I did lightly ask him about changing the hyperlink targeting & his simple reply was:

[font=Arial][size=2][color=navy][color=navy][font=Arial]Shouldn’t be too difficult, you can simply edit the **getURL(someexpressionhere, “frametarget”)**[/font][/color][/color][/size][/font]  
[font=Arial][size=2][color=navy][color=navy][font=Arial][/font][/color][/color][/size][/font]

I did find where the getURL function is in the FLA, but anything I tried was an absolute (because I have lame Flash coding skills!). I even did some searching on the net for examples and none of them worked either. Obviously the menu wasn’t designed to handle multiple types of hyperlink targets.

So, I’m wondering if a Flash guru on here can help me figure this out. That is, if this menu doesn’t have to be totally reinvented!

I do hope I don’t come off sounding too confusing - and of course…any help on this would be grandioso!

thank you.

---

<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:** [September 16, 2004, 12:33am UTC](https://forum.kirupa.com/t/flash-xml-help-with-geturl-function/64413/2 "2004-09-16T00:33:45Z")

</div>

inside movieclip “hhorizontalmenu” you have a layer called the same.

look for the line

```auto

getURL(this._parent._parent.myxml.childNodes[this._parent.mynum-1].attributes.link);
	};

```

now… i think

```auto

getURL(this._parent._parent.myxml.childNodes[this._parent.mynum-1].attributes.link,"_self");
	};

```

should work 🙂

---

<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:** [September 16, 2004, 12:49am UTC](https://forum.kirupa.com/t/flash-xml-help-with-geturl-function/64413/3 "2004-09-16T00:49:40Z")

</div>

Digitalosophy,

You da MAN!

I’ve updated the example.swf file to reflect this change, and used “\_blank” instead of “\_self” so it will open any hyperlink in a new window – Works great!

[http://www.ff-squad.com/dev/horzmenu/example.htm](http://www.ff-squad.com/dev/horzmenu/example.htm)

Now…  
Is it possible to easily make any of the links a combination of different targeting types? ie. “mainFrame”, “\_parent”, “\_blank”, etc.? Or will that call for some serious Flash code & XML revamping?

thanks for the excellent help so far!

---

<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:** [September 16, 2004, 1:08am UTC](https://forum.kirupa.com/t/flash-xml-help-with-geturl-function/64413/4 "2004-09-16T01:08:01Z")

</div>

your very welcome…

any of these will work :“mainFrame”, “\_parent”, “\_blank” 🙂

btw - welcome to the fourms!

---

<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:** [September 16, 2004, 1:22am UTC](https://forum.kirupa.com/t/flash-xml-help-with-geturl-function/64413/5 "2004-09-16T01:22:15Z")

</div>

thanks! :ne:

Actually what I meant was…

If you go to my example.htm, mouseover ‘Menu’, you get 4 sub items that appear. For each of those 4 sub items I’d like to set each one of them up with different target types.

easy to setup? or is some serious revamping involved?

> [@Digitalosophy](#):
>
> your very welcome…
> 
> any of these will work :“mainFrame”, “\_parent”, “\_blank” 🙂
> 
> btw - welcome to the fourms!

---

<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:** [September 16, 2004, 2:26pm UTC](https://forum.kirupa.com/t/flash-xml-help-with-geturl-function/64413/6 "2004-09-16T14:26:51Z")

</div>

Something like this should work, but yes your going to have to understand what’s going on to fix it to do this.

```auto

myButton.myUrl = menuItem*.attributes.URL;
				myButton.myTarget = menuItem*.attributes.TARGET;

				myButton.onRelease = function() {
					getURL(this.myUrl, this.myTarget);
					trace(this.buttonLabel.text+" : "+this.myURL);
				}

```

XML file:

```auto

<ITEM NAME="Miscellaneous" URL="asp/misc.asp" TARGET="myFrame" />	
	
	<ITEM NAME="National Archives" URL="asp/natArchives.asp" TARGET="myFrame" />

	<ITEM NAME="Printing" URL="asp/printing.asp" TARGET="myFrame" />

```

In this case you can make target whatever you want.

I’m off to jersey for a day or two so I probably won’t see your reply, unless you hurry up :lol:

---

<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:** [September 16, 2004, 9:58pm UTC](https://forum.kirupa.com/t/flash-xml-help-with-geturl-function/64413/7 "2004-09-16T21:58:54Z")

</div>

wonderful!  
I understand the XML side of it, but I’ll need a little help on implementing the Actionstripting…

hope your still around today…if not…its ok I can wait till next week.

thanks again!

> [@Digitalosophy](#):
>
> Something like this should work, but yes your going to have to understand what’s going on to fix it to do this.
> 
> ```auto
> 
> myButton.myUrl = menuItem*.attributes.URL;
> myButton.myTarget = menuItem*.attributes.TARGET;
>  
> myButton.onRelease = function() {
> getURL(this.myUrl, this.myTarget);
> trace(this.buttonLabel.text+" : "+this.myURL);
> }
> 
> ```
> 
> XML file:
> 
> ```auto
> 
> <ITEM NAME="Miscellaneous" URL="asp/misc.asp" TARGET="myFrame" />	
>  
> <ITEM NAME="National Archives" URL="asp/natArchives.asp" TARGET="myFrame" />
>  
> <ITEM NAME="Printing" URL="asp/printing.asp" TARGET="myFrame" />
> 
> ```
> 
> In this case you can make target whatever you want.
> 
> I’m off to jersey for a day or two so I probably won’t see your reply, unless you hurry up :lol:

---

<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:** [September 20, 2004, 8:15am UTC](https://forum.kirupa.com/t/flash-xml-help-with-geturl-function/64413/8 "2004-09-20T08:15:21Z")

</div>

bump thread for **Digitalosophy** when he gets a chance to help :puzzle:

---

<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:** [September 23, 2004, 7:34pm UTC](https://forum.kirupa.com/t/flash-xml-help-with-geturl-function/64413/9 "2004-09-23T19:34:05Z")

</div>

> [@katman](#):
>
> bump thread for **Digitalosophy** when he gets a chance to help :puzzle:

bump x2 for Digitalosophy’s help! thanks…

---

<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:** [September 27, 2004, 8:57pm UTC](https://forum.kirupa.com/t/flash-xml-help-with-geturl-function/64413/10 "2004-09-27T20:57:52Z")

</div>

> [@katman](#):
>
> bump x2 for Digitalosophy’s help! thanks…

bump
