I need to pass a variable to a function inside a function. However this parameter (i) seems not to be passed (to function ...onRollOver). This is required to attach a textfield to a movieclip (reading the adress and showing it as a tooltip).
ActionScript Code: for (i=0; i<array_BE_ElecCities.length; i++) { var attachElecCity = mc_map.mc_places.attachMovie("Plant",
so, i think it's just cause it's the end of the day and my brain wants to quit, but i would like some input.
im trying to pass a function to a question box that when you click the YES button the function passed in will fire for some reason im having a hard time holding the function until the YES is clicked.
here is what i got Code: //the call that opens the choice box and sets the info the gui_obj part is cause the //funciton is in a separate class file gui_obj.displayChoice("Add the cell phone to your inventory?", "YES", "NO", gui_obj.addToInventory(item))
I'm new to AS3, I have an index.swf that loads thumbnail images from this file (projects_list.xml). When the user clicks on a thumbnail image I want it to pass the selected thumbnails "link" node information to the callFull function. You can see that I have managed to get it to work when I use the real path name. I just can't figure out how to pass the link node text.
Projects_list.xml file set up Code: <project id="0" name="Con" thumb="portfolio/images/con/thumbs/web_1_200pix.jpg" htm="" link="portfolio/xml/desc/desc_con.xml"></project> desc_con.xml file set up (details file) [Code].....
I have 3 movieclips in the Libarary, called (both by name and class) section0, section1 and section2.This works for instance to attach a movie clip to the stage:
Code: var myMovie:MovieClip = new section1; addChild(myMovie);
This is a function on the first frame of a .fla updated to AS3 from an old AS2 file:[code]When the function is called it should set "max_messages" to 600 in AS3, right?
I have 2 methods in a class and 2 properties. The first method fetchXMLData() gets data from an XML file. In the addEventListener method on the urlLoader object, I pass it a listener which tries to set the returned data to the xmlData property. However, it never sets it, and I know the data comes back because I can alert out urlLoader.data using the mx.controls.Alert component.
I have a movie clip that contains several movie clips, only one of which should be shown at a time. Which one is shown, depends on what buttons the user selects.Having trouble with the syntax for passing the argument in a button to the function that controls the tweening of the clips. (When I hard code the references into the function, it works, so I know the basic function is ok).There's a clip called 'slide1_mc' which contains various MC's to be shown based on user selection (in this case, using 'system' clip as the first one already showing). Here's the code in the parent clip of that item:
Code: var currSection = slide1_mc.system_mc; function changeSection(newSection):Void { TweenLite.to(currSection,.3,{_yscale:200, _xscale:200, _alpha:0});
[code]....
Here's one of serveral buttons that will control the content to be seen:
So - the initial part of my function works so I know my 'external' initializing of "currSection" is working (that clip is zooming/fading out)... but then the clip that I want to fade in isn't doing anything.
I'm creating a jeopardy like game and have run into a problem. when you click on the dollar amount a create a sprite on the fly and inside the sprite is a shape and some textfields. One of the fields is an input box. once you enter in an answer and press enter I create another sprite with a textfield inside it to let you know if the answer is right or wrong. Herein lies the problem. once your told if your right or wrong, I want the sprites to stay on the screen for 3 seconds then disappear.
I can get them to stay on the screen, but I can't get then to disappear because I can't pass the sprite to the function that I created to remove them. So everything works except the remove function. This is the error I get when the remove function runs: "TypeError: Error #1009: Cannot access a property or method of a null object reference."
I'd post some code but its broken What I'm looking for is just information on how to assign a sprite to a variable so I can use it in a function. if thats not possible then is there a better way to do what I need done?
Hello, I'm trying to minimize code, so I am trying to use functions, and need to pass some strings through them in order for it to work.I believe I may be doing this incorrectly, so could someone please take a look and tell me what I'm doing wrong? On one of my movieclips:
[code]...
What that previous code should do is loop through all movieclips in the game and if it's not named player, move it in accordance to what "Direction" is.If the player is pressing the arrow down key, it will change "Direction" to "DOWN" and hopefully pass it.
I have an index.swf that loads thumbnail images from this file (projects_list.xml). When the user clicks on a thumbnail image I want it to pass the selected thumbnails "link" node information to the callFull function. You can see that I have managed to get it to work when I use the real path name. I just can't figure out how to pass the link node text.
If I remember correctly, objects are being passed to functions by reference, so I wrapped my primitive variable into object but did not get the resilt I wanted. I combed this group to see the solution and found only this one:
function changeObjectStatus(obj) { return obj.status = true; }
[Code]....
var v seems to be a new object rather then a reference to the old one. and changing v does not affect the original object.
Does this mean that if I want the function to work with several variables, I need to create a separate object for each variable?
when doing something like passing an array of movieclips to a function then trying to access the name of the movieclip (a[i].name) why does it give instance names instead of the names passed in.
Here is example code from a function I'm trying to use to enable whatever navigation movieclips i pass into it:
ActionScript Code: function enableNavButton(a:Array):void { for(var i = 0; i < a.length; i++) {
I have a global function that does some stuff with a LoadVars in it.I 90% of the cases, the onLoad reference of the LoadVars is the same, but I sometimes need to do something else when the LoadVars is loaded.Is there a way to pass a function reference to a function so that I could do something like that :
[AS] _global.function myFunction(maybeFunction) { myLoadVars = new LoadVars();
What I want to be able to do is pass the name of the movie clip (ie mc_01, mc_02...) to the function, and have the function effect that particular movie clip. I had this code that didn't work
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
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";
I have this script that reads pictures and links of the pictures from the an xml file, display the picture and then put the link for the image, but I can't seem to pass the link to the onRelease function anyone can help me on this, below is the code:
i am loading an image with a loader, and in onComplete function i would like to call calculateRatio function and pass it Loader.content.width and Loader.content.height so it can compare it with the current stage width and height and resize image proporcionally to fit the screen. how would i go about passing that parameters?
It seems that with as3, the error compiler is just waiting to get you.I have a function that loads in an external swf. Which swf depends on which button they click. So, it could be pic1.swf, pic2.swf, pic3.swf, etc.
function loadMovie(){ my_mc.addChild(my_Loader); addChild(my_mc);[code].....
When i test, I get "error: access to undefined property myVariable.