Search  

SWF NAME AS VARIABLE

HomeForumsHelp Neededswf name as variable
Default-profile youmustfeed
2 posts
Bought between 10 and 49 items

hello.

im building an xml driven folio site. it loads external swf’s for each of the categories of the folio – each needs a seperate xml file.

is there a way to use the swf name to load an xml file with the same name – ie, folio1.swf loads folio1.xml into it….the swf reads its own name and uses that to then load the xml.

its obviously not the end of the world to do it manually but would be loads easier if it read the name as it would save a load of fiddling about and make things easier.

AS2 if you can. thanks for your help mike

Posted 2 months ago
16450 Fougie
275 posts
Exclusive author Author was featured Referred at least one person Sold between 1 000 and 5 000 dollars Bought between 1 and 9 items

The concept you are asking for is very simple. There are many ways to accomplish that. However, the solution would have to be tailored to fit your project.

So what you are probably more in need of, is a Flash Freelancer to set it up for you. We can’t really provide you a solution on the forums without knowing how your project works to begin with.

Posted 2 months ago
40437 Marvidude
40 posts
Sold between 1 and 100 dollars

Hello, youmustfeed

yeah you can do that, i have actually created the script which gets the swf name from inside the flash movie and converts it to .xml , if you are interested. contact me through myDen

or

email: marvidude [at] hotmail [.] com

Posted 2 months ago
40437 Marvidude
40 posts
Sold between 1 and 100 dollars

well here is the preview of what i talked about in the previous post

fileNameToXmlName

waiting for you feedback

Regards

Marvidude.

Posted about 1 month ago
22362 theflyingtinman
379 posts
Sold between 1 and 100 dollars

I think this should work :

        var i = _root._url.split("/").length-1;
        var namePart: Array = (_root._url.split("/")[i].split("."));
        var xmlFile = namePart[0] + ".xml";         
        trace (xmlFile);
Posted about 1 month ago
40437 Marvidude
40 posts
Sold between 1 and 100 dollars

Hello, theflyingtinman

The script that you have posted doesnt work is it AS 3 ?.

Regards Marvidude.

Posted about 1 month ago
36675 LuizZak
198 posts
Referred at least one person Sold between 100 and 1 000 dollars Bought between 1 and 9 items
Hello, theflyingtinman

The script that you have posted doesnt work is it AS 3 ?.

Regards Marvidude.

I think it’s AS2

Posted about 1 month ago
22362 theflyingtinman
379 posts
Sold between 1 and 100 dollars
Hello, theflyingtinman

The script that you have posted doesnt work is it AS 3 ?.

Regards Marvidude.

It’s AS2 (as requested) and it works fine when I compile it:

filename.swf

and the exact same file with a different name:

copyoffilename.swf

The code in both these files:
var i = _root._url.split("/").length-1;
var namePart: Array = (_root._url.split("/")[i].split("."));
var xmlFile = namePart[0] + ".xml";         
varName = "This file is named : " + xmlFile;

.

Posted about 1 month ago
Default-profile youmustfeed
2 posts
Bought between 10 and 49 items

hey up – that worked a treat mr tinman….thanks so much for that.

Posted about 1 month ago