Passing A Filename As A Variable..is It A String?
Hey can someone help me,
I want to set a variable as a file name,
i.e variable_1 = "file_1.exe"; How should I declare it? I was declaring it as above but it was being passed as a string and wasn't being picked up by my other functions, I also tried without the inverted commas and it wasn't being picked up at all, any advise? Cheers
FlashKit > Flash Help > Flash ActionScript
Posted on: 06-05-2002, 07:33 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Passing A String Into A Variable Name
I have a function, and as a result of the function, I want it to create a value in a variable. The string is passed in a button as this,
on (release) {
this.boxCheck("x1");
}
function boxCheck(letter) {
if (this[letter]._currentframe == 2) {
this[letter].gotoAndStop(1);
} else if (this[letter]._currentframe == 1) {
this[letter].gotoAndStop(2);
}
HERE I WANT TO CREATE A VARIABLE THAT WOULD CONTAIN THE STRING IN IT. SO FOR THIS INSTANCE, I WANT TO CREATE A VARIABLE NAMED: x1selected = 1;
How can I do this passing the string to keep it dynamic?
like this? this[letter] + "selected" = 1;
}
Any ideas?
Passing A Variable To Flash Via Url String
I understand how to get a variable into flash when it's hard coded into the html using Flashvars or this is how I do it with SWFObject:
where variable: location=subdirectory
Code:
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("featuredviewer.swf", "featuredviewer", "620", "480", "8", "#fff");
so.addVariable("location", "subdirectory");
so.write("logo");
// ]]>
</script>
What I don't understand and can't find is how to do this...
I have an html file with an swf in it. Different buttons in the file open a popup window via javascript. I want to pass a variable to the swf in the pop up window, possibly like this:
Code:
on (release) {
getURL("javascript:Launch('featuredviewer.html?position=one')");
}
But how do you extract the variable position=one out of the url and get it into flash?
Passing Variable On Querry String To PHP
I'm building a upload app and need to send my php script some info when I call my upload script. I've established a var ID.
Can someone confirm if my syntax is correct.
ActionScript Code:
fileRef.upload("upload.php?userid='+ID+'");
Thanks!
Passing A Variable To A Query String
I am trying to create a form in Flash that passes variables to a query string. Simple enough, but when my variables have an underscore (eg variable_one) Flash coverts the underscore to “%5F”. I noticed that it seems to convert all non letter or number characters to something else. Unfortunately I don’t have the option to change the names of the variables I am passing.
This is the code:
submit.onRelease = function () {
getURL ("http://www.actionscript.org","", "GET");
};
Has anyone encountered this? Help Please!
Passing Variable From An HTML Query String
HELP?
I am using the javascript
window.document.smoothie.SetVariable("_root.texty" , query);
in an HTML page, to pass the value in 'query' to a dynamic text box, 'texty' on the main timeline of my Flash movie.
The passing of the variable works, and can be seen on any one of these 3 pages:
http://www.runspotrun.com/test/page2.html?chewbacca
http://www.runspotrun.com/test/page2.html?hansolo
http://www.runspotrun.com/test/page2.html?obiwan
If the value of query is 'chewbacca' then what loads on the page is different than if the value is 'hansolo' and so on...
The passing of this variable works, EXCEPT - one needs to RELOAD the page to see it. When the movie/page first loads, the value doesn't appear. If it is reloaded, then the value appears. A following visit to the same page, even passing a different variable will work fine also. It's just that very first visit, the first time the movie is opened on a particular browser.
After many hours of trying to figure this out, I am at a loss. Can anyone help me with this please?
ThankS!
mark
Passing Variable To FLVPlayback Via Query String
This seems very easy but I am stuck here....
Here's the html that I'm trying to pass the flv name to the FLV component
Attach Code
In the html
<param name="movie" value="/proxy/MC-video-component.1.swf?flvName=vod/q1_2009_mkt_story">
and in AS i have an instance of the FLVPlayback component on the stage
var flvName;
myFLVPlayback.source = "rtmp://myFMSserver.org/" + flvName +".flv";
Any help?
Trouble Loading A Text File When Passing The Variable In The URL String
I am trying to load variables into Flash from a text file. I pass the name of the text file as a variable in the URL string and then use that variable in the loadVariables command to pull in the text file. It works fine locally but is unreliable up on the server.
I seem to have got past this problem by moving the action to frame 2 from frame 1.
Has anyone else experienced problems with this and has found a better resolution?
Passing Filename To SWF
Hi Guru's,
Does anyone know a tutorial or has some code to pass the htm or php filename to a flash movie on that page? I was thinking to somehow link the filename to a variable and then pass this to the swf.
But my problem is I don't know how to retreive the filename.
Anyone any ideas?
Cheers
Selecting A Just The Filename From The Whole Path String
hi flashers,
wondered if you could help me figure this one out, i have a path to a file in a variable, in the format:
file:///C|/Documents%20and%20Settings/person/My%20Documents/Flash%20Development/JSFL/myfile.as
i want to remove all of the file path information and just grab the filename and file extension. how am i best doing this?
Many thanks in advance chaps and chappettes,
j
Selecting A Just The Filename From The Whole Path String
hi flashers,
wondered if you could help me figure this one out, i have a path to a file in a variable, in the format:
file:///C|/Documents%20and%20Settings/person/My%20Documents/Flash%20Development/JSFL/myfile.as
i want to remove all of the file path information and just grab the filename and file extension. how am i best doing this?
Many thanks in advance chaps and chappettes,
j
Filename = Variable
hi,
I'm trying to get a specific mp3-file where the filename are stored in a variable. the mp3-file are in a folder and I can't get the link to work. if I don't have the mp3-file in a folder it works but does anyone know how I should do if the file is in a folder?
the code look like this right now:
_global.berattare.loadSound("pc/sound/"_global.varFil+".mp3", true);
if I set [] around the variablename it says that the script are ok but it still not working.
Swf Filename Variable
I was wondering how to retrieve the currently opened swf's filename and use it as a variable.
Thanks!
chilled
Filename To Variable.
i have an FLA file, where i want to convert the FLA's file name into a string.
is it possible to retrieve the file name and convert it into a variable?
(inside the same file)
Variable Xml Filename
Hi,
I am using a xml connector in my action script and i have a predefined xml filename to be used with the connector. Can i pass the xml filename from the php code to the xml file? I want it so that the xml filename can be dynamic. This might be a solution for the problem I am having where multiple users accessing my flash application see the same data (which doesnot belong to them) because there is only one xml file.
Thanks
Max
Filename As Variable
Hi,
I have the following problem: I am loading a flash movie into another flash movie (actually into the MonoSlideShow). I can only place the different movies I want to load in a single folder called images but it can't containt subfolders. This would be no problem since I could give every movie inside the images folder a different name. However each of those movies loads an XML file. In the future I do not want to touch the FLA files and if I add another movie into the images folder it should automatically load the correct XML file (which by the way all are placed in the same folder as the movies). So since I don't know what the movies are going to be called or how many there are going to be I can't specify the correct XML filename in advance! So my question is: can I specify a variable that changes according to the filenmae of my swf file (example: filename of the swf file = test1 so then the swf movie knows that it should load the XML file test).?
Thanks,
#include Filename From A Variable
i would like to set the name of the file to be included dynamically.. i am running into a problem because it will not let me do double quotation marks:
whichFile = myScript;
#include """+whichFile+".as"+"""
trying to get it to evaluate it so that it ends up being :
#include "myScript.as"
any ideas?
Include# With A Variable Filename
Hey Folks,
I'm getting an error with the following lines
//---
theVar = "GA_"
#include "c:/as_repository/" + theVar + "write.as"
//---
The file name should be "c:/as_repository/GA_write.as". This
changes for each state.
The error suggests that I have a "Malformed #include directive".
After reading that, I feel I should see a doctor.
Can one use the Include# statement with a concatenated string
like the one above?
I'm using Flash MX 2004 Pro.
Thanks,
Saving XML With Variable Filename In Php
Hi All!
First: glad to be on this forum - it looks great!
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).
Hope You can help me, thanks!
Making Filename A Variable
Hi all,
Does anyone one know if 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.
Thanks in advance,
Bret
Making Part Of A Filename A Variable?
Hey all,
I'll keep this short: how do you make part of filename a variable (to later be displayed in a textbox)?
I ask this because I want to have a slide-show of sorts that is easily maintained and updated by the addition and re-naming of image files. For example, by calling a file "picture1.jpg" it will be displayed as "picture1" in the flash file.
I know there are some commands the exist for separating strings into smaller sections (words or letters) But I want to know is there a way of saying "make everything after the / symbol a variable and cut off the filename"? So if you placed that picture.jpg in folder so the filepath looked something like this "/images/beach/image1.jpg" it would return the variable "image1"?
Thanks for your time.
Loading External Flash Files Using A Variable As Filename
ok I have made a flash file and what I want it to do is take a variable like path and use that to load the movie. For example the url will be "www.example.com/1.swf?path=2.swf" that will set path to the file I want to load into my movie how do I use loadMovie() to load the file using that variable. also once I load the movie how do I place it in my flash file. and how do I set where it goes ect.
Max
MX: Can I Use Filename.swf?122 Instead Of Filename.swf?file=122
Can i use filename.swf?122 instead of filename.swf?file=122 and somehow program actionscript to "listen" for external variables and if it detects one is automatically the value of "file"?
And is it also possible to use something like filename.swf?122&33&44
And again use AS to "listen" for 3 variables values?
Grtz,
Problem Passing Variable Values (from XML) To Variable In Child Movie
I'm reading something from XML, and store it in a variable. I can trace the variable and it shows two items. I can display those two seperately with variable[0] and [1], meaning that it works as intended.
After that, I'm calling a movieclip, which is supposed to read that variable.. sadly, it can't do it. So I resorted to passing the content of the first variable to a variable inside the called movieclip. This works, and tracing the second variable shows both items from the first. However, I cannot access the items seperately with variable2[0] for example.
What's the problem? The second variable is currently a string. I tried to declare is as other things (like xml or array) as well, but that didn't help. Is there also a way to make this procedure unnecessary, i.e. can I somehow access the first variable?
I've attached the fla/xml/swf in case my description doesn't make sense!
Can Trace String But Cannot Set String To Variable
Hi,
I am importing a some text values from a text file and then trying to pass this value via a function
I can TRACE the text value successfully but cannot set it to a variable.
************************************************** **************
function test(){
var aTestVariable
myData = new LoadVars()
myData.load("thenews.html")
myData.onLoad= function(success){
if(success){
trace(myData.Title); //THIS WORKS
aTestVariable = (myData.Title);
}
}
return aTestVariable
}
function testFunction() {
trace(test()); //THIS DOES NOT WORK!
}
************************************************** **************
Can someone please tell me what is wrong with this:
trace(myData.Title); //THIS WORKS
aTestVariable = (myData.Title);
HELP!
Rich
Passing SQL String To PHP
hi...
what im trying to do is: pass a complete sql string to a php script. this works fine for passing numbers for the SQL WHERE conditions (e.g. "SELECT * FROM myTable WHERE YEAR(mydate)=2005").
but as soon as i try sending strings (e.g. "SELECT * FROM myTable WHERE YEAR(mydate)=2005 AND item='myItem'"), php just won't process it.
the same goes if i wrap that statement into escape();
i also tried putting in and leaving out the inverted commas....
I'm using loadVars() and sendAndLoad() for this action...
anyone ever encountered this problem???
Passing XML String
Alright, so I am trying to pass an XML file as a String from a JSP page. I know the JSP code works and it creates a String of XML data that is formatted correctly, however when I try to load into my flash I am getting undefined errors.
This flash code works if I try to load a file locally or off the server, but unfortunately I cannot load it that way, I need to load it from this JSP as a String.
Here is the AS code:
Code:
myXml = new XML();
myXml.load("rssloader.jsp");
news = new XMLSA();
news.load(myXml);
XMLSA just takes a formatted XML() object and returns it as an array, this has all been verified to work as well.
Passing A String
Ok, so Im passing a param (proLabel) from an asfunction to another function (byeByeContent). It traces correctly from byeByeContent function, but will not work as a frame label. If I replace the param with the string "pro1" all works fine. Whats wrong?
Attach Code
// asfunc
function showPro(proLabel:String) {
proHighlightClick = true;
byeByeContent(mNavContent_3_mc,"NA",proLabel);
reset();
mNavbar_mc.mNav_3_btn.enabled = false;
mNavbar_mc.mNav_3_btn.btnAni_mc.gotoAndPlay(11);
//trace(proLabel);
}
// show/hide content
function byeByeContent(viewContent:MovieClip, bannerPos:String, proPos:String) {
//.. cut alot of things out
if (viewContent == mNavContent_1_mc) {
mNavContent_1_mc.gotoAndStop("lastFrame");
//reset2();
viewContent._visible = true;
} else if (proHighlightClick) {
// this ius where proPos traces fine "pro1" but doesnt gotoandPlay the frame labeled pro1
viewContent._visible = true;
viewContent.gotoAndPlay(proPos);
}}
String Passing
I am trying to create a string on the main stage which I will use to load swf's externally into a scroll pane. Say I create a string called name (name = new String()) and when I click the button called home, name is changed to home.swf (name = "Home.swf"). The button home also loads a movie onto the main stage from the library called animation which is a nice little preloader and a couple of things flying around before I want the page to show up. Within the movie I just called onto the main stage, I include the code myScrollPane.loadScrollContent(name). How come it doesnt load Home.swf when I click the home button?
How To Store A String Plus A Variable In A Dynamic Text Variable?
Hi,
I've got a dynamic text field with the instance name rightAnswer_txt.
I declare the variable in the frame it resides in, with the following code var rightAnswer_txt:String = "";
Then, when I want to populate it using the following code:
rightAnswer_txt.text = "You scored " + rightAnswers;
the script comes out with an error saying ...
**Error** Scene=Scene 1, layer=actions, frame=7:Line 15: There is no property with the name 'text'.
rightAnswer_txt.text = "You scored " + rightAnswers;
Any idea what this means anyone please?
Passing Vars In AS3 Without Using URL String?
Hello,
I have one AS3 swf (loader.swf) that needs to load a second AS3 file (main.swf).
loader.swf has some variables that I would like to pass to main.swf.
I don't want to append the variables in the URL string, because then main.swf won't be cached properly.
In AS2 I could use FlashVars, which passes the variables without adding them to the URL string.
How can I do this in AS3?
Passing Var:string To New URLRequest
Hi,
I have a main movie on which I have two buttons that each should load a new external movie when clicked.
The code on frame one for each button is:
Code:
function onIntroClick(evt:MouseEvent):void {
var language:String="english.swf"
gotoAndPlay(2);
}
english.addEventListener(MouseEvent.CLICK, onIntroClick);
and
Code:
function onIntroClick2(evt:MouseEvent):void {
var language:String="french.swf"
gotoAndPlay(2);
}
french.addEventListener(MouseEvent.CLICK, onIntroClick2);
on frame 20 I have the following code, which should load the external movie (either the english.swf or the french.swf) in the main movie.
The code is as follows :
Code:
var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest(language));
function loop(e:ProgressEvent):void
{
var perc:Number = e.bytesLoaded / e.bytesTotal;
percent.text = Math.ceil(perc*100).toString();
}
function done(e:Event):void
{
removeChildAt(0);
percent = null;
addChild(l);
}
stop();
This doesn't work as I get an error 1120: access of undefined property language.
What am I doing wrong or what should I do to do it right ?
Thanks for your assistance.
Smalco
Passing String Into Flash
Hi All,
I was wondering if someone could help me out with some trouble I'm having. I've tried to find tutorials for this but it seems to be missing the what I'm looking for. I want to pass a string into flash from a php page. I know I have to have the string in the object. But I don't know how to write the code so flash can understand. I want to have the string value be entered into a text box. Any help would be great thanks..
Passing A String To A Function
Hi I want to pass a varible (a string) to a function when I roll over a
button. I have tried this but it does not work.
var ross:String('hello');
freshnLogo_mc.addEventListener(MouseEvent.ROLL_OVER, oneRollover, ross);
function oneRollover(event:MouseEvent, ross):void {
trace('you passed' + ross);
}
Passing A String To An External MC
I load my external swf....
var myRequest1:URLRequest = new URLRequest("external.swf");
myLoader1.load(myRequest1);
var _content:MovieClip = MovieClip(myLoader1.content);
stage.addChild(_content);
_content.myname ="Albert";
on the first frame of the external swf
trace("hello you" + myname);
I get an error. How Do I do this?
Thanks
Passing Data With Query String
I'm trying to 'pass-through' a variable in a flash movie.
Basically I'm using flash to create a form that needs to be posted back to a server side database, using get url this is no problem.
However I want to populate the flash movie with a value that when the get url command is exectued, this value is passed back to the database.
e.g.
I have a variable called "AdvertID" it's value is "100". I know this before I play the movie, so I call the movie thus:
embed src "movie.swf?AdvertID=100" etc.
However when flash posts this data back using get url, it doesn't appear as one of the variables.
I do not want the user to see this value (however if they must I can live with it).
Do I have to declare "AdvertID" as a variable for this to work?
If I do where?
Thanks.
Passing String Variables To Flash
I am passing variables in a url string from an asp page to my .swf file and reading the variables into text boxes within flash.
eg.
http://www.mywebpage/pageFlash.asp?...ameVar=François
As you can see, the variable I am using contains a special french character.
Now here is the problem. On some computers the variable is passed to flash with no problem at all and on other computers the same flash file is unable to read the variable. I have tried url encoding the variable to read %E7 and also have placed System.useCodePage=true; on my first line of actionscript, but neither works.
Does anyone know why the special character works on some computers and not on others? All the computers have IE 6 and are running Windows 2000.
Passing String To Target In LoadVariables
for the loadVariables function, I have a file to be loaded. however as for the target, i have no definate target. but a string of the target will be produced in the code. but it doesnt seems to work when i put the string of the target address to the target parameter of loadVariables. how can i get it work?
thanks
[CS3] Passing Variables From Query String
Hi there,
i'm trying to pass a variable from a web page to a flash file. The flash file has a dynamic text box with the var value set to formError.
In the webpage i have the following code:
<script type="text/javascript">
var so = new SWFObject("flash/index_030308.swf?t=150", "mymovie", "938", "305", "8", "#FFFFFF");
so.addParam("allowScriptAccess", "sameDomain");
so.addParam("quality", "high");
so.addVariable("formError", "<%=request.QueryString("formError")%>");
</script>
to test i am typing in the address bar default.asp?formError=woteva, hoping to see "woteva" displayed in my dynamic text box in the flash file, but this isn't the case. Where am i going wrong?
Passing Class Names As A String...
Hi People,
I need to pass a class name to a function acting as a class 'instancer' (bad english, sorry)
I've tried [] and eval but no result...
one of wrong cases I've tried:
Code:
showModule = function(moduleClass:String){
var module = new eval(moduleClass)(_level0.module_container);
}
thanks
Passing String Info Via MovieClip?
Hello.
I'll try to explain what I'm looking for, I haven't started coding yet so have nothing to show.
I have 190 movieclips which display various types of information. When a user clicks on a movieclip, it has to tween larger but also send a string to a method. I'll probably e.currentTarget to use one function which contains a tween and I wondered if there was a quick way to pass string info in a similar way?
So, each movieclip has it's own value which can be passed to a method which will use that value. The only way I can think of so far is to have 190 functions which send the string data to the appropriate place. I'm trying to avoid that if I can.
Thank you.
Passing A Query String To Flash
Here's the need:
I'm going to be making a gallery of "thumbnails" which are all a flash file dynamically loading new content in each. So a single html page will house up to 48 copies of that same swf loading a new picture in each.
There has to be a way to load a flash file with a query at the end, right (in the html source code)? Like filename.swf?id=123&thispage=123 right? If so, how do I access those variables passed to flash?
My idea was to write my standard loop (in PHP) posting a new swf in each iteration but change the query string with each so that I can load the new content.
MX : Passing Variables To Command String
I'm trying to design an interface that to simplify the construction of a string. Here's an example: My output (using the getURL command) needs to be in the form of:
http://fakesite.com:8080/java/submit...ng2=y&thing3=z
I'm able to define variables for x, y, and z, however I am unable to figure out how to substitute the defined values for those variables into the string when it is time to send it.
I may not be being very clear here, but does anyone have any ideas?
Thanks
Jeff Kirsch
Passing Variables Via Query String
i am trying to load different xml that get generated through .net when I am trying to pass varibels i am getting undefined. Can someone give me a heads up on what i might be doing wrong. from what I have read and learned I can pull via-
Code:
xmlData.load("/family/galleryimage.xml.aspx?pid=" + _root.loaderInfo.parameters.pid.toString());
Then I am defining pid in within the object class.
Code:
<param name="pid" value='<% =Request.QueryString["pid"] %>'>
However I am getting undefined. Any help is much appreciated, thanks.
MT
Trouble Passing String Var Into Function
im making a function that limmits text to a specified number...
only problem is i cant seem to pass in the text var that contains the text
any help would be awesome.
thanks in advance
ActionScript Code:
var textF1:String = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam neque purus, aliquam sed, sagittis tincidunt, adipiscing ac, urna. Ut libero urna, nonummy sodalesxxx";function TrimText(limmit:Number, area, textVar) { var lengthF1:Number = [textVar].length; trace(lengthF1); var charLimmit:Number = limmit; for (var i:Number = 0; i<=charLimmit; i++) { trace(i); if (i == 0) { textcut = [textVar].charAt(i); } else { textcut += [textVar].charAt(i); trace(textcut); if (i == charLimmit && lengthF1>=charLimmit) { textcut += "..."; _root[area].text = textcut; trace(area); } else { _root[area].text = textcut; } } }}TrimText(160,"texttest",textF1);
MX : Passing Variables To Command String
I'm trying to design an interface that to simplify the construction of a string. Here's an example: My output (using the getURL command) needs to be in the form of:
http://fakesite.com:8080/java/submit...ng2=y&thing3=z
I'm able to define variables for x, y, and z, however I am unable to figure out how to substitute the defined values for those variables into the string when it is time to send it.
I may not be being very clear here, but does anyone have any ideas?
Thanks
Jeff Kirsch
Passing Query String From Address Bar URL Into Swf
Hi All,
Let me preface this by saying that I'm primarily a design/animation/marketing guy so this could be a stupid question with an obvious answer. However, I have been scouring the web for two days now and have yet to find any posts/tutorials which offer a solution.
Here's the challenge:
I have a flash movie that movie is contained within the same included file on every page of a site. I need some way of telling the flash which pages it's on so it can display the appropriate XML feed. Since each of my pages has a query string in the URL (i.e. thesite.com?page=1) I imagine the best way to do this is to somehow send the string into the flash movie. Once it's inside the movie I'll write a function that pairs the each string with it's corresponding XML feed (btw, if anyone has an a similar script they can post it would be a huge help to me!).
Note that because the movie is part of an include that is on ever page its parameters (such as EMBED tags) cannot be changed either.
The only solution outside of directly passing the query string from the page URL (as it appears in the address bar) to the flash would be to create some sort of Javascript in the HTML that captures the query string and then sends it along.
If anyone can help me out with this it would be GREATLY APPRECIATED.
Thank you in advance!
Change String Variable To A MovieClip Variable
Hi
I have been banging my head against a brick wall regarding the following problem which must be very simple to fix, just can't see the answer.
I have a class assigned to a movieclip called canvas. The class is called drawClass. I have called the instance of canvas on the stage 'drawingCanvas'.
When I trace "drawingCanvas" I get
[object drawClass]
which is fine. Tracing drawingCanvas.name gets me the instance name
'drawingCanvas'.
This is a String variable.
Basically what I am trying to do is pass the MovieClip name to another class. In my example the class 'toolBar', which can then interact with the MovieClip.
The problem is passing 'drawingCanvas.name' results in a String, so I get an error saying :
TypeError: Error #1034: Type Coercion failed: cannot convert "canvasArea" to flash.display.MovieClip.
I can't for love or money find a way to convert a String variable to a MovieClip variable! I have the name of the MovieClip, I just need to tell the toolbar class. But I can't find a way of doing this as the instance on stage is an object of drawingClass, not a MovieClip (unless MovieClips with attached classes are not treated as standard MovieClips?).
Any ideas are most welcome. I'm sure I am missing something obvious.
Thanks for looking
Convert String Variable Into Movieclip Variable?
I have a variable called something like city_str which has a value of "toronto". I also have a moveclip (exported for AS) called toronto_mc.
What I want is a way of concatenating strings of "toronto" and "_mc" and assigning it to a movieclip variable called toronto_mc. Everything I try gives me a mismatch error in the compiler. I'm writing AS2 using Flash CS3. Any ideas?
|