ActionScript 2.0 :: Using Mc Vars In Function?
Aug 16, 2003
ok, first of all, im not totally sure how to describe my problem so im going to recreate a simple example of what im trying to do...
my problem is that im not sure how to refer to a dynamic mc in a function...i know that sounds confusing but maybe this will help...
lets say i have a function like:
[Code]...
the problem with this is that the function looks for an mc titled "mcName"...and the function is hard coded...what i want to do....is to reuse this function with any movieClip on the timeline i want...so how do i refer to the mc in the function dynamically? i hope this makes sense?
ive also tried something like this
_root[mcName]_x = 123;
but this doesnt work either....ive seen something like this done before...using brackets to target an mc with a var...
View 1 Replies
Similar Posts:
Aug 19, 2009
ActionScript Code:
private var __milena:LoadVars;
private function Loadprom(prom:String):Void {
[code].....
View 5 Replies
Nov 19, 2009
I want to add about 10 textBoxes and I want them all to be contained in different variable names. I need to declare them outside the document constructor function because of scope, but how then can I use them in a function? I want something like
[Code]...
View 1 Replies
Jan 21, 2008
I am trying to make a button that when clicked on loads an external text file into a dynamic text box.
I can make it work when I use it specifically - but I can't make it work when I want to use it as part of a generic 'button function'.
Basically I have a .txt file "mycontent.txt" which is called using the Load Vars function inside a generic function (tab_grow) i created to managed the behavior of the 12 tabs that are the navigation for the movie. For now i'm just focusing on ONE of the tabs. Basically the tabs move when a user hovers over them and when they mouse off. When they click it should call the external text file. The section in the .txt i'm calling is called 'mega_data'.
This is what I have right now:
HTML Code:
function tab_grow(mov, file) {
mov.onRollOver = function() {
mov.onEnterFrame = function() {
[Code].....
BUT then I can't change which section of the .txt file I pull up for different tabs - which is the whole point of the function!!
View 1 Replies
Jun 21, 2010
Could anyone suggest how to fix the function at the bottom so that when button forward_btn with label "Go to next Training Point" when clicked recalculates the fields created in function fileLoaded.[code]
View 2 Replies
Mar 2, 2007
Is there any advantage to deleting vars instantiated within public or private functions in a class, or are they removed from memory after the function has been invoked/run? The function below is completely arbitrary for example:
ActionScript Code:
private function someFunctionHere(_ar:Array):Void {
var _swf:String = _ar[0];
[Code].....
View 2 Replies
Mar 2, 2007
Is there any advantage to deleting vars instantiated within public or private functions in a class, or are they removed from memory after the function has been invoked/run? The function below is completely arbitrary for example:
Code:
private function someFunctionHere(_ar:Array):Void {
var _swf:String = _ar[0];
var _nm:String = _ar[1];
[Code]....
View 4 Replies
Dec 14, 2006
Im trying to write a function that will build a menu based upon the vars that I passed it to. This is a simpler version on the code.(The library has a MC/Btn symbol with the linkage "btn");
Code:
function bulidMenu(nItems:Number) {
var menuMCx:Number = 100;
var menuMCy:Number = 100;
[code]...
Why do I get an output of 4 on every clicked button, instead of 0,1,2,3 ? I tryed forwarding the " i " to the onRelease = function(i) {} and then in it declaring a new var and assigning it the passed " i ", but that doesn't work either :/
View 4 Replies
Jan 4, 2010
i'm sending flash vars to php, but the .swf refresh when the function "send" is call.
fo exemple:
var myFlashVars:LoadVars = new LoadVars();
myFlashVars.cor="Blue";
myFlashVars.send("http://urlpage.php","_self");
is somehow more correct to do it?
View 4 Replies
May 19, 2005
i am trying to load vars from a text file into a load vars object.
var kitchentext = new LoadVars();
kitchentext.load('moccastext.txt');
Once in the object, i thought i could reference them like so
kitchentext.name
kitchentext.style
but i am having trouble doing this.
i have a textbox called displytext.
_root.displaytext.text = kitchentext.name;
doesnt work
View 3 Replies
Jun 19, 2011
I got an input function in witch i set all the variable i want to display. To make it clean i would like to input any number of vars without having to change my input function to avoid the "Expecting more/less arguments". Then i would like to get any type of var (bool num int ....) in the input and then check their type, instead of declaring the first input var being exclusively a number for example. Is that possible and how, don't know if i was clear,
View 5 Replies
Nov 1, 2010
I've got a Vector of ViewToActionMap objects, which have following constructor:
public function ViewToActionMap(_forModule:eModule,
_forAction:eViewAction,
_toFunction:Function,
[code].....
View 1 Replies
Jul 22, 2010
I'm building a little application in AS3 but I need to get variables from PHP. I searched on the internet on how I should do that. It makes the connection, but it doesn't get the variables. It just prints whole my php script.
[Code]...
View 1 Replies
Feb 26, 2008
I think this should not be a big deal, but I do not get it to work. I got a "MainFlash" witch loades an XML with about 60 variables (Settings), in base of a paramater then this "MainFlash" loades another "FlashMovie" and this one needs, all, the same Variables too.
How do I properly pass all the Vars in the new/other "FlashMovie"?
U need to know I use LoadMovieNum to Level 0 I do replace the "MainFlash", cause the new loaded "FlashMovie" can have a completly different height and width ( ...I don't think it's possible to change the Document-Setting in a compiled swf, or is it? If this is possible I would not need to load a separate swf to Level 0. the main SWF usually ist about 320x180, the following can be 2x, 3x bigger...
View 2 Replies
Dec 7, 2009
var navChildXml:XML = <subpoint>
<text>XML(_nodes[prop].childNodes[inc].title)</text>
<link>XML(_nodes[prop].childNodes[inc].title)</link>
</subpoint>;
how to in this instance
the vars are not being declared
View 1 Replies
Jul 7, 2009
I've created a Flash interface that sends variables to PHP to place in MySQL.In Flash I have the following AS2 (abbreviated) ..
myVars=new LoadVars();
submit_btn.onRelease=function() {
myVars.username=_root.username;[code]..........
Invariably the else statement is deployed and a new record is inserted into the database even when the username and passwords (md5 encrypted) are identical. I've been on PHP forums and nobody has a solution, so I'm wondering if this is a Flash issue. Perhaps even though the username and password in MySQL 'appear' identical to what's submitted by Flash and md5 encrypted they're really not for some reason. I tried trim() and stripslashes() to no avail.
View 5 Replies
Jun 9, 2010
I have set something up for my flashvars. I have a form in html which accepts two inputs. This is then sent to this php page
[Code]...
View 9 Replies
Apr 18, 2009
how can I do this trick and keep different vars for each mc?
for(var i=0; i<arr.length; i++) {
var mc[i] = _root.createEmptyMovieClip('mc'+i, _root.getNextHighestDepth());}
View 1 Replies
Jan 30, 2009
i have two swf files, a preloader witch loads main.swf
in preloader on the maintimeline i set this var
var lang:String = "de";
but i cant trace it in my main.swf
trace(root.lang);
how do i get this var?
View 7 Replies
Feb 9, 2009
this should be simple as nothing but i just need to get a clearer picture here my PHP has this as final line
[Code]...
where $newPics is a number what do I insert in AS code to to retrieve that variable and store it as an AS variable?
View 5 Replies
Jun 24, 2009
I've surfed for days to find a solution to this. There are a jillion out there, but I haven't found one that works. Suppose I have the following
<?php
header('location:http://www.sleepydad.com?firstName=s...ame=dad');
// the above URL will house my Flash movie
?>
I need to get the values of firstName and lastName into my Flash movie to save as variables (ultimately LoadVars()) and pass as an ID for some MySQL tasks performed in my Flash movie. NOTE the value of the names are not constant (ie sleepy dad). They will change with login - each user having a unique name. I've tried modifying the javascript in my HTML - some.swf?firstName=firstName (in both Object & Embed Tags)
[Code]....
View 0 Replies
Dec 13, 2009
I am working on a project that uses PHP , as3, and possibly some AMFPHP.
The project allows users to upload and download images among other things. I have been trying to gather as much info about making things as secure as possible. I've got some good advise about using .htaccess files, and a few other tricks.
My main question at the moment is how to hide the "path" info from and to the PHP / assets / and to and from the AMFPHP sevices ...
Currently I have all the paths hard-coded in one .as that returns an object with the paths to any of the other classes that need/request it. I found this method to work well since I only need to change this one .AS , and it will branch out to the other classes that need it.
I'm not super worried about others decompiling my code, and they could probably "sniff" out the paths if they really wanted. I'm mostly concerned with allowing others easy access to all of my AMFPHP services or being allowed to parts of the site I do not wish them to be. basically I realize that things aren't gonna be 100% secure regardless, but would like to take precautions.
So to cut to the chase ... Whats the best- simplest way to obscure / hide the paths being used in a PHP - AS3 project ? ... I entertained the possibly of PHP includes or even a SQL database if need be. I rather not spend a bunch of time and money on questionable obfuscator software, unless there's a tried and true one for flash (not flex). .. and I currently do not have a SSL but don't know how critical - common this is.
View 0 Replies
Feb 9, 2010
When I run the flash from my local host (using XAMPP) it all works fine. But when I put the whole thing onto my online web server and change the URL to access the php file, its just coming back as "NaN" ...so why does it work on my local server but not the online one?
View 6 Replies
Aug 3, 2004
ok I have a load vars function that looks for a txt file and grabs data from it, right now they have to be in the same dir. I'd like to have the txt in the root of my server and then be able to link from any dir in the site...I have: ("dataValues.txt")what should I add before it, I thought maybe a full URL, but no, is it something like ("../dataValues.txt"), basically I want to make the link global for the site - I dont have access to the files right now so I cant just try a bunch of stuff myself.
View 1 Replies
Aug 19, 2005
Im trying to pass a huge string (12k) to my flash from the browser using the param embed tags.
HTML e.g.
<param name="movie" value="/pix/inzalo/menutest/080105v28_slim_Menu.swf?menuData=data_data_data_da ta....
[Code]....
The flash recieves the data just fine if its not so large. I know that flash can accept vars that are up to 64k big.
My flash does have a preloader for the swf but I think that I need some kind of LoarVars preloader for it? (oddly enough if I half the data size of the var's being passed in to the flash then it render's just fine in FF but does nothing in IE?)
View 2 Replies
Apr 16, 2003
Well, I've come across a problem and i'm stumped. Anyway, I stumbled upon this aim online presence check in an old AIM pdf file. There is a server check at an aol server to see if a person is online, if they are it sends the browser to the "on_url" setting, if not, it sends the browser to the "off_url" setting. I realized that it doesn't work for some screen names for some reason, but it does for mine, so i wanted to use it in flash. I've tried three ways, and two of them WORK! But, only when I run them from my computer... When I upload it to my host, it doesn't work! Here's the two ways I've tried:
[code]...
Again, the first two WORK when running the SWF locally, but for some reason not on a couple of hosts that i've tried.. maybe i'm going about this the wrong way. I've thought about making some php script to do this then have AS read the PHP, but then i'm not sure about the PHP code on that.
View 4 Replies
Feb 5, 2007
i have just been looking for a simple solution to send vars to php.I have found a lot of threads that have problems but no results.I hope that someone can give me a quick fix..or is this just a mission.
[Code]...
View 8 Replies
Mar 22, 2009
i'm trying to fill out dynamic text fields by adding to my url like so:url...if the url could link to the html in which the swf was loaded instead of to the swf directly, that would be even better... but that might or might not complicate things (i don't know)
View 8 Replies
Apr 2, 2009
I have to pass some variables to the flash movie (movie.swf?var1=aaa&var2=bbb). never had a problem with using them before.I've read around a lot an tried different coding, but when I export the swf I got the error, that root is unknown...doesn't matter, if I use one of this
var flashvars:Object = root.loaderInfo.parameters;
var flashvars:Object = stage.loaderInfo.parameters; // stage is unknown here..
var flashvars:Object = MovieClip(root).loaderInfo.parameters;
var flashvars:Object = MovieClip(root.loaderInfo).parameters;
[code]....
View 4 Replies
Mar 20, 2010
noobish question, i have several variables, say var1, var2, var3. In as2 we simply write:
[Code]...
View 5 Replies