IDE :: Calling Multiple Similarly Named Objects In A Function?
Aug 26, 2009
I've got an issue with resizing multiple similarly named objects.I've got the following code that works: mc0.nb0.autoSize = "left"
nb0 is a text box placed inside mc0, which is a movie clip. My script simply resizes the box, according to the ammount of text inside it. what I'm trying to achieve is a more dynamic code that would work for no matter how many boxes...I tried something like "mc"+i."nb"+i. autoSize = "left", but I get a syntax error. So, how do I call the MC inside the function?
View 7 Replies
Similar Posts:
Feb 14, 2010
If I want to send an object to a function with one child called foo equals "bar", i need to do the following:[code]is there a way to declare the object in the function itself ? something like that:[code]
View 1 Replies
Apr 2, 2009
I have a flash project that exports at around 3MB, I am trying to create a preloader for it but it seems to get called after the preloading is complete, there for, making it useless. My stage is empty, nothing on the timeline. The preloading script is called in the main document class. Does anyone know why this isn't working, am I calling my preloader function at the wrong place or are my objects in the library loading first? Here is the code,
[Code]...
View 4 Replies
Jan 29, 2012
I've been having a problem with multiple event listeners calling the same function (this is just a snippet of the code):
ActionScript Code:
stage.addEventListener(MouseEvent.MOUSE_UP,Stop_Scale,false,0,true);
stage.addEventListener(Event.MOUSE_LEAVE,Stop_Scale,false,0,true);
[code]......
View 8 Replies
Apr 28, 2009
I am building a scrolling image bar, so I've created code that works perfect on one object. However, I need this code to apply to multiple objects at once so that they will move left and right and resize independently from each other (to give this sort of 3d revolving look). Other boxes will be to left and right of the current black box. Code is below as well as link.
Code:
function mousetracker(object){
boxstartx=object._x;
boxstartwidth=object._width;
[code]....
View 1 Replies
Mar 8, 2011
I have 4 mc on my stage which i want to tween to a specific size (400x400) on MOUSE_OVER. I would like to assign each mc the same function to achieve this. I have half achieved this with the code below, however when I MOUSE_OVER one of the mc, the stage also resizes. I would like to avoid using XML if possible.
This is my code.
Select allmc1.addEventListener(MouseEvent.MOUSE_OVER, thumbOver);
mc1.addEventListener(MouseEvent.MOUSE_OUT, thumbOut);
mc2.addEventListener(MouseEvent.MOUSE_OVER, thumbOver);
mc2.addEventListener(MouseEvent.MOUSE_OUT, thumbOut);
mc3.addEventListener(MouseEvent.MOUSE_OVER, thumbOver);
mc3.addEventListener(MouseEvent.MOUSE_OUT, thumbOut);
[Code] .....
View 4 Replies
Jun 22, 2010
I have a function that returns an object full of data pulled when an XML file gets parsed. But I also need to use an array object with additional data. That array also gets built in the same function. Is there a way to return both? I am trying to get both the "Obj" and "SlideTime[idx]" data to use as globals.[code]
View 4 Replies
Oct 19, 2010
I have a custom component as an item renderer.In this renderer there is an item called dlFirstChoice.Now when I add more items to this list and force the list to rebuild itself something odd happens.Part of the creation of the renderer I set a default selection for the DropDownlist as follows: dlFirstChoice.selectedIndex=0The problem is once I have more than one item to render from my dataset this property stops working. So if my dataset has only 1 item to render the drop downlist sets itseld up properly, the momment I need to render more than 1 copy of my item renderer, all of a sudden nothing gets set fo
View 1 Replies
Apr 24, 2009
on loading multiple external swf on single button... I mean on click of next or previous button may I load external swf with different name on targeted instance....?
View 9 Replies
Jan 31, 2011
I am trying to delete multiple rows in the sqlite table in my Adobe AIR app (runtime 2.5).
Here is the statement, using the "IN" operator:
"DELETE FROM mylist WHERE tdId IN (tdId1, tdId2, tdId3, ...)";
Where tdId1, tdId2, etc. will be determined at runtime based on which row(s) the user chooses to delete. The user can delete arbitrary number of rows.
I've tried something like:
//delete statement text
"DELETE FROM mylist WHERE tdId IN :tdId";
//delete statement parameters: take 1.
[Code].....
It would seem too much of trouble to chain these deletes with a callback. So I guess I am using my last resort: building the sql at runtime. Conclusion: Cached statements can't be used in these kind of situations...
View 2 Replies
Apr 24, 2011
As you can see from the image, even if rotationY property of all 4 items are the same, they do not rotate at same amount. Each image are inside of a container and containers are added to stage. Why is it the case?
View 2 Replies
Dec 9, 2010
I've dynamically created a grid of buttons which are going to modify a 2D array, but I can't work out how to create a unique function for each iteration of the loop with a dynamic function name. Probably just a stupid syntax error by me...
ActionScript Code:
for(var i:int = 0; i < 8; i++){
for(var j:int = 0; j <
[code].....
View 3 Replies
Sep 23, 2011
I have an AS3 function that loads and audio file and then plays it. I have the pre-loader for the first audio file working - now I need to run the pre-load function before the 2nd audio file starts.
myMusic.addEventListener(ProgressEvent.PROGRESS, onLoadProgress2, false,0, true);
myMusic.addEventListener(Event.COMPLETE, playMusicNow, false, 0,true);
myMusic.load(soundFile, myContext); //This code works
[code].....
View 2 Replies
Feb 26, 2010
i'm trying to modify some code and can't figure out what the issue i'm having it. this is the(shortened) code:
public static function Lose():void {
trace("OVER!");
Clock.stop();[code]...
this is the error i get: 1180: Call to a possibly undefined method OverIt.i just want to call a function from inside of the public static funtion.both function are inside this class:
public class Game extends MovieClip {
}
View 4 Replies
May 12, 2004
Okay so I am reading through sens tutorial on OOP and updating my game that I am making. It is much easier to code this way (IMO) but still hitting snags.I am trying to get through this code:
[Code]...
View 3 Replies
Sep 10, 2009
im creating a small drag and drop game in AS3-
I have 4 objects and 4 targets,
I want to be able to drag any of the 4 objects onto any of the targets, right now all I can manage is to allow each object drop onto one specific target only.
I thought by calling all my target names by the same instance name eg target_mc that would work but only one target will ever work.
View 8 Replies
Dec 8, 2009
function test1():void
{
function test2():void {..}
[code].....
View 6 Replies
May 12, 2004
Okay so I am reading through sens tutorial on OOP and updating my game that I am making. It is much easier to code this way (IMO) but still hitting snags. I am trying to get through this code:
[Code]...
View 3 Replies
Mar 23, 2010
how can i call a function that is inside another function.like:
Code:
function abc() {function uvw() {
}
function xyz() {[code].....
View 3 Replies
Sep 20, 2010
I currently have an over, out and click event for 8 different objects. The over and out events are identical for each (tween expands object and then shrinks it back for the out state).I have previously asked for an easy way to declare those events, and now I was looking for an easier way to handle them.
Here's my code:
//-----------GARAGE
function growGarage(e:MouseEvent):void{
scaleTweenX = new Tween(map_garage, "scaleX", Elastic.easeOut, 0.648, 1, 0.5, true);
[code]....
I've tried using a single function and then using "this" as the object of the tween but that expanded the entire stage.
View 1 Replies
Apr 15, 2012
I'm new with strings and arrays. I want script to calling display objects to the stage and the timer to move images up and down to appear like a scrolling numbers. I start getting sloppy, and mess up passing to Tweener.
- An explanation or strategy may be enough, "I've got pretty close on this one"
- There was confusion regarding the Containers and addChildren...looked like arrays
The code "get as far as error with NumbersView and numbers undefined etc".
import flash.display.DisplayObject;
import flash.display.MovieClip;
import flash.utils.Dictionary;
import flash.events.Event;
import caurina.transitions.Tweener;
[Code] .....
The methods were proved separately. "I got a earlier version of the document going, but I need to work through this to understand it."
Symbol Properties
Class ImageView
Tweener
The "caurina" folder needs to be present
Rolling Numbers "Success loading numbers and connecting to counter".
Placed the movie clip object on stage with two dynamic text fields in it. Make sure the container is placed on stage, has the two text fields in it, and everything is given a proper instance name. Also include the caurina folder.
Seconds MovieClip symbol with instance name of seconds
firstDigit Dynamic text field with instance name of firstDigit, placed in seconds
secondDigit Dynamic text field with instance name of secondDigit, placed in seconds
Symbol
Un-tick 'Export for ActionScript'
Use 'Name, Class, and Instance' correctly
View 1 Replies
Oct 18, 2006
How can you call objects based on properties they have instead of object names? For example if i want all the objects in an area to move somewhere else. Thats not what im trying to do but just an example. Also im using flash mx 2004
View 1 Replies
Oct 18, 2010
so i'm working mostly in a main class file. up until now subclasses (or the class for objects that i'm using in my game) have really only contained methods that controlled property values, and properties. however, i'm now interested in making an enemy in my game, but doing almost all the code for the enemy in the class file. i need to figure out how to communicate and check the object instance of the class against an object instance being controlled by the main class.
View 13 Replies
Jan 17, 2011
here is my new code that works for PART of my movie. i have two dynamic text boxes, one named "item" and one named "ssnumber" ssnumberNode works fine but itemNode does not. i bolded the parts that i think are relevant to the problems
[Code]...
View 3 Replies
Oct 11, 2009
What's the best way to say:
if(this.object in same array as that.object)
with multiple arrays containing multiple objects?
View 2 Replies
Oct 9, 2010
I'm trying to get this one function to be able to call many functions (not at once, but call many possible ones)In other words, I'm trying to get this variable to be named as a function. That way, this one variable can create multiple functions.example:
actionscript Code:
class Thing extends MovieClip{ var funcvar; var othervar; function onLoad() funcvar = "YYY"; othervar = "ZZZ"; function onEnterFrame()
[code].....
View 1 Replies
Jul 20, 2009
How do I call an object from the library in ActionScript 3.0? Once I do, how do I refer back to the timeline in ActionScript 3.0?
View 7 Replies
Mar 8, 2010
I hope that this is possible. I can't seem to find any info on it on the web. I need to call a function from within a function. I'm not sure if there is a name for doing this that I don't know of?This is some example code of what I'm trying to achieve:
Actionscript Code:
someTimer.addEventListener(TimerEvent.TIMER, functionWithin);function mainFunction():void{ function functionWithin():void }}
[code]....
View 3 Replies
Sep 11, 2009
how can i open "insider" function from "start_function"?
ActionScript Code:
start_function();
function start_function():void {
[code].....
View 3 Replies
Sep 25, 2009
I read online, and I understand kinda what the error is stating. Though, I can't find out why.So basically what I understand is that I am calling a function that is not a function?ere is the error and code portions that are required.TypeError: Error #1006: value is not a function.at VideoPlayer_fla::MainTimeline/startVideoPlayer()at VideoPlayer_fla::MainTimeline/frame1()
View 2 Replies