ActionScript 2.0 :: Making Filename A Variable

Apr 21, 2006

it's possible to have AS take the filename of itself and make it a variable. I need it to be done by AS only. I know it's possible in PHP, but I'm not sure about AS. I'm guessing if it's possible it's one line of code. I'm using Flash 8 but publishing at Flash 6, AS 2.

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Saving XML With Variable Filename In Php?

Jan 26, 2006

I'm trying to save an XML file on a remote server via an php file, and so far this works fine by following the tutorial on this site - exept one thing...I would like to define the filename of my XML file to be saved via php in flash dynamically, eg. so I can create several XML's from flash. But how is this possible ?- can an entry in the passed XML file be read in an easy way in PHP4 - or can I send a variable along with the XML object with some wrapping (maybee an advanced object).

View 1 Replies

Flex - Embed Image With A String Variable Which Contains A Filename?

Jun 26, 2010

I try to embed images in a mx:tree:

<mx:Tree labelField="name" id="tree"
folderOpenIcon="@Embed(source='assets/images/test.png')"
folderClosedIcon="@Embed(source='assets/images/test.png')"
defaultLeafIcon="@Embed(source='assets/images/test.png')">
</mx:Tree>

This works fine, but I will embed the images with a String variable.

[Code]...

View 3 Replies

ActionScript 3.0 :: Select Variable Filename From Local Directory With Fn To Load XML

Aug 23, 2011

I would like to select a specific xml file to load from a local directory. The file name is composed of "Title" + "number sequence". I know the Title (in this case its XLink07), but I need to select the latest number sequence or the latest by date stamp.

For example, the local directory has the following files:
XLink01[36735298100].xml
XLink02[36735298100].xml
XLink02[36735298101].xml
XLink07[36735298100].xml
XLink07[36735298101].xml

In this example I need to select file XLink07[XXXXXXXXXXX].xml where XXXXXXXXXXX is the highest number within the XLink07[XXXXXXXXXXX].xml files. Title is Xlink07 and function should return Number sequence [36735298101]. Files with higher number sequence have later date stamps than files with lower number sequences. I need to select the highest number or the latest date stamp for the file that begins with XLink07.

My action script to load the local .xml file without any function to select the correct file is:
Security.allowDomain("*", "*")
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("XLink07[36735298101].xml"));
xmlLoader.addEventListener(Event.COMPLETE, showXML);
function showXML(e:Event):void {
[Code] .....

View 1 Replies

ActionScript 3.0 :: Pass Textbox Value As Variable For URL/Filename To NetStream.play(url)

Oct 1, 2009

I would like to pass a value from a text box on stage as the URL or filename to the NetStream.play() argument. example:

var url:String = url_text.text;
var conn:NetConnection = new NetConnection();
conn.connect(null);

[Code].....

The point of the matter is that I'm pulling the values from JavaScript/HTML using the ExternalInterface which changes as the user selects next on a HTML page. The page name (URL) is being parsed and passed back as the video filename. I'm using the text boxes currently just to test/view the values being received and sent to JavaScript. The value send and receive fine, I just can not seem to pass the value into the NetStream.play(JavaScriptValue).

function getTextFromJavaScript(str:String):void {
sending_ti.text = str;
var jsArgument:String = sending_ti.text;

[Code].....

View 1 Replies

ActionScript 2.0 :: Exchange A Filename/url (like "XMLtoLoad") By A More General Variable?

Jun 25, 2003

I have the following question: How can i load a dynamic xml, i.e. the .xml file that will be generated automatically and thus gets different names.I want flash to "listen" to a variable "file", that is "file" represents the name of the xml-file to load. Like showXml.swf?file=abcd1234.xml. btw i don't exactly use the xml extension so it becomes showXml.swf?file=abcd1234

I using a general name = "XMLtoLoad" to load my xml.My AS right now is somthing like:

file = XMLtoLoad;
_root.xmlDocument.load("XMLtoLoad");

how can i exchange a filename/url (like "XMLtoLoad") by a more general variable? Or maybe i should ask how can i convert the name after "?file=" to a URL within AS

View 2 Replies

ActionScript 2.0 :: Making A Variable With X And Y Position?

Feb 12, 2009

I am working on a client who wants a "Game-like" tour of their facilities on their website. I can use flash and do some very basic actionscript ..especially cutting and pasting

At any rate, I have character that moves on the main tour map and he starts in the parking lot...he can go from one screen ( scene ) to another. But when the character returns to the main tour map he always starts at the same location. As opposed to starting where he just came from. Such as if he just went into the "Process Plant" he should start on the main map at the "Proccessing plant" ... Can I set the X Y coordinates in some type of variable that remembers where he came from when he exits another scene and returns to the main map...?

View 6 Replies

ActionScript 3.0 :: Making A Variable Name With A String?

Jan 12, 2010

I've moved to actionscript 3.0 from PHP, and there are some things I just do not get. For example, making a variable name with another variable.Let's say I have movieclips called object1, object2, object3 and so on. I used Math.round() and Math.random() to get a random integer number, and I want to select one of my movieclips according to this number I get.
In php, you can do this:

PHP Code:
<?php
$objectNumber 1;//Let's say this is a random number

[code].....

View 8 Replies

ActionScript 3.0 :: Variable Making Loop

Sep 7, 2010

[Code]...

so what i want it to do is making 10 varibles named Name1 - 10

View 9 Replies

ActionScript 2.0 :: [FMX] Making A Random Variable?

Dec 24, 2002

Making a random variable?

View 9 Replies

ActionScript 2.0 :: Making A Variable Available Outside A Function?

Feb 20, 2006

Basically I'm trying to load a variable from an external file and then make that variable available for anything.

Code:
var where;
locSource = new LoadVars ();
locSource.load("source.txt");[code]....

I've tried all the variations of this I can think of. I've defined "where" as a global variable both outside and inside the function, tried to define a separate global value within the function (and changed the syntax of the trace accordingly in either case), nothing works. Basically, the function is being loaded properly; if I put the trace inside the function it shows up perfectly, but the variable isn't available for anything else, which is what I need to happen.

View 4 Replies

ActionScript 3.0 :: Making A String Contain The Name Of Another Variable?

May 3, 2010

var myNumberArray:Array = new Array;
myNumberArray[1] = new Object;
myNumberArray[1].myProperty = 10;

[Code]....

This obviously traces out the string "myNumberArray[1].myProperty", completely disregarding that there's already a variable/property called myNumberArray[1].myProperty, which has a value of its own.

Tracing out this[myStringVariable] just gives an 'undefined'.

Is there any way to get it to trace "10", using only the 'myStringVariable'? In other words, to make AS understand that myStringVariable contains the name of another variable/property?

View 4 Replies

ActionScript 3.0 :: Making One Variable Available To Multiple Classes?

Jan 15, 2011

I'd have thought this to be simple, but nothing works. I have a game I'm working on, and in it, there will be a speed stat. The fast you are going, the faster everything else has to move to make it look like you are moving faster.The problem is, the speed stat (obviously not called speed) is one of the upgradable stats, and needs to be available for the class handling upgrades for it to be changed, and it needs to be read by the class handling moving objects.The second class however, has absolutely no idea the variable even exists. I've tried for weeks to look up a tutorial on it, but there doesn't seem to be any at all that I can find. (I am using public variables, and have tried various ways of trying to point at the class it's from but apparently I must be using the wrong syntax)

View 12 Replies

Making Something Happen After A Variable Has Been On The Stage For A Certain Time?

Dec 13, 2011

I'm making an Elder Scrolls type game and I want my enemies to hurt me after a certain time.So pretend like 5 seconds after they come on the stage they would take 5 hp off me.Then when one of the enemies die it stops until another enemy comes on the stage then it counts how long its been on the stage.This is what I have so far:

Actionscript Code:
var tmr1:Timer=new Timer(2800); var tmr2:Timer=new Timer(5000);

[code]...

View 1 Replies

Professional :: Making And Loading Variable Classes

Feb 13, 2012

AS3 says you need to load variables into a class?my variables look like this... (the whole point of playing around with variables was that if I had to make a change I could access one place and change them but now I realse that I can't access or call them outside the movie clip they are in.[code] The Wholesale price. A wholesaler is usually a big shed where goods are stored.

View 7 Replies

ActionScript 3.0 :: Making A Universal Variable As A Counter?

Aug 19, 2009

I've got an animation that plays, and then at the end of the timeline plays a movieclip. This movieclip displays a piece of text, which is extracted from an XML file, the piece of text is selected at random currently out of a list.

Then when the clip is pressed (button), it goes back to the previous timeline, and then plays through again, including the movieclip, and now a new piece of text is picked at random and displayed.I now want to make the pieces of text display sequentially, but am having some trouble.

put in a counter, and the text that is displayed from the array corresponds with the number on the counter, unfortunately, this gets wiped every time it plays, because the counter gets remade. Is there any way to create a variable outside of the timeline maybe, in a actionscript file maybe, so that I can just add to this. I have been running a trace, and can't seem to get it to not wipe.

View 3 Replies

ActionScript 3.0 :: Making A Local Variable Global?

Sep 7, 2011

I have a problem where I make a variable in one class and change it using the constructor method in another.Is there anyway that I can make that variable available in all methods in this class? Here is the code:

[Code]...

View 3 Replies

ActionScript 2.0 :: Making A For-loop With Button Variable?

Jul 31, 2002

The situation is like this:I have Five buttons named button1 to Button5.What I want is to make one button invisible.To to this I have a for 1 to 5 -loop and I want to make one button invisible if it meets certain criteria.Is this possible without make an if-line for each button or not??

View 4 Replies

ActionScript 2.0 :: Making An Imported Variable ( From Php ) Into A Number

Nov 2, 2004

im importing a few variables with this [code]but now how do i make a variable say root.cash into a a number which can be used in equations or used for logical compariosons such as < > ==

View 2 Replies

ActionScript 2.0 :: Making A Imported Variable ( From Php ) Into A Number?

Nov 2, 2004

im importing a few variables with this

Code:
myVars = new LoadVars();
myVars.load("getinfo.php?user1="+userN+"&pass45="+passN+"&random="+refresh1,"0");

[code]......

View 2 Replies

ActionScript 2.0 :: Making Button Invisible Using Its Instance In Variable

May 1, 2006

I am just trying to make a button disappear using a variable set to it's instance name. When I say invisible I also mean deactivated. The code I've got is this..
Code:
[test]_visible = false;
but it doesn't work - any offers?

View 5 Replies

IDE :: Making A Global String Variable Visible To MovieClips?

Jun 4, 2009

I mostly use flash for the animation, so my action script tends to be mostly functional.

I am now however having an issue, i am using a variable called language which I am setting in frame one as "dutch", "english" , "german" etc... Im then using this to set dynamic text as appropriate in each frame as necessary.(and yes i may switch this to case statements )

if (language == "dutch")
{ tcMC.peasantBubble1.peasantSpeech.text= "Bescherm je een schat?"};

My problem is however that one Movieclip does not see the language variable.

Is there anway in CS4 i can direct it to where it is, or define the varibale instead to be global (perhaps id have to change it from a string though)?

View 2 Replies

ActionScript 2.0 :: Multiple Classes Accessing The Same Variable Without Making It Public?

Dec 26, 2006

i've got two classes and i'm not extending to MovieClip. I like to attach the mc in the constructor just because i'll be working with different MC's that have the same purpose.

however, im using private var loadedMC:Movieclip and now i've got another class that needs to be able to access the instance's variable.

for example, myClass.loadedMC , but this would mean having to make it public and I rather not go that route.

View 2 Replies

ActionScript 3.0 :: SWF Knows Its Own Filename Or URL Somehow?

Jan 28, 2010

How can one access the name of the file or URL which loaded the file?

View 1 Replies

Actionscript 3 :: Correct Way Of Making Variable Accessible To A Child Class / Object

Mar 4, 2011

When you initialize a new object, how can that class have access to a variable from the parent?In this case Blob needs to be able to access scale?[code]

View 2 Replies

ActionScript 3.0 :: Access Of Undef Prop Error - Making Private Variable Public

Apr 27, 2010

I have the below script as part of a small application I'm building. The script just creates cue-points along a movies timeline so we can add events etc to those cue-points.

[Code]....

It's creating the cue-points well, although I'd like to use the below variable outside of this function.

Code: var stampName When I try and use it I get an access of undefined property error, which I believe relates to the variables being private and within the function - but I can't seem to find a method to get this varibale public.

View 2 Replies

Actionscript 3.0 :: Get Actual Url (not SWF Filename)

Jan 7, 2009

I am trying to retrieve my SWF's referring document filename. For example, if index.html is calling mymovie.swf, I want to return index.html. I know this can be done through a combination of scripting and flashVars, but I would like to avoid that for security purposes. The flashVars variables can be seen by anyone who knows how to view source. Is there a way to accomplish this solely in Actionscript? or Flex?

View 10 Replies

ActionScript 3.0 :: How To Get The Path Or Filename Of GetChild

Aug 19, 2010

Does anyone here knows how to get the path or the filename of an object inserted to the stage?

Here's the scenario:I'm developing a flash app, that enables the user to insert background to the stage by using the Browse and select using the FileReference in flash. I have successfully inserted whatever image the user choose, but what i'm trying to do is that if the user clicks save, the background image that he/she has selected will be copied to another folder on the web (uploads folder). Thus i need to know the path and filename of the background image.

[Code]...

View 7 Replies

Flash :: Get A Random Filename From A Directory In AS3?

Sep 21, 2010

I need to get a random filename from a directory in AS3, and open it. (This will be online, so no AIR)

I'm thinking of just using a text/xml file with all the filenames listed, and just traverse through it getting the filename. But is there a more "direct" way to just look at the directory so I don't have to edit the text/xml file all the time?

View 1 Replies

Android :: Convert Between URL And Windows Filename (AIR)?

Nov 27, 2011

I am trying to save images to the disk in an AIR app for smartphones. I need a method, that can convert safely Web URLs to valid filenames on Android & iOS (if it would retain Windows/Mac compatibility it'd be good.), and i can get back the original full URL from the filename. For example:[URL]..Encoded format is something like (this is just some example i found out now):http%d%s%swww.google.com%tsearch%rclient%z

And i'd need a method to convert it back. I've looked into BASE64 - but this allows the "/" character, and im afraid to use HEX encoding, because this will generate super long filenames, and URLs can be lengthy.
According to another question, in iOS the max length pathname is 1024 bytes: max length of file name

Anyone has a solution for AIR? Basically this is the same question as Convert between URL and windows filename (Java)? - just for AIR, iOS, Android.should i simply modify a BASE64 encoder, and do some hacks for long filenames?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved