Flash/XML - help with getURL function

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

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.

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

look for the line


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

now… i think


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

should work :slight_smile:

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

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!

your very welcome…

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

btw - welcome to the fourms!

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?

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


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:


<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:

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!

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

bump x2 for Digitalosophy’s help! thanks…

bump