ActionScript 2.0 :: Joining Two Variables To Make One?

Jul 15, 2011

What i have on the stage are lots of balls each with there on name b1,b2,b3 etc. and i have something that is going to hit it with hitTest.

Insted of hardcoding all the balls into the hitTest i want to have a variable containing the first part of the objects name (_root.b) then add i on the the end and i would loop from 1 to how many balls are on the stage eg. 10.

so for my code at the moment I don't have a loop but using "i = 0"

Here is my code:

ActionScript Code:
onClipEvent (enterFrame) {
i = 1;
j = "_root.b"+i+".ball2";

[Code]......

When i trace "mcName" it shows "_root.b1.ball2" which is the correct object, but the hitTest doesn't seem to see it and fails.

If i put mcName as "_root.b1.ball2" (hardcoding it) it works.

Ive tried so many different tweaks and just can't seem to get it to do it.

View 1 Replies


Similar Posts:


Actionscript 3 :: Joining Sprites Together?

Nov 13, 2010

So created a Sprite to which I add other Sprites which are game tiles. Each tile is 60 x 60 px big. In result I've the Sprite with about 200 childs (those tiles).When I try to startDrag() the container sprite the lag when moving it is very noticeable..

Is there a way like to join the tile Sprites so the container would have only 1 child Sprite instead of 200? Because it lags so much probably cause it needs to move (change the x and y) all those 200 tiles.. Am I correct?In this case I can't use the cacheAsBitmap property, cause user can zoom in or zoom out the map..

View 3 Replies

Joining 3 Separate Flash Movies?

Oct 6, 2009

So I'm making a flash slideshow of baby pictures for my wedding, and I made 3 separate files, however I would like them all to play one after the other without any interruptionsIs there a way to link them or should I just try to rebuild the 2nd and 3rd files into the 1st

View 1 Replies

Professional :: Joining Several Swf Files Into One Swf File

Apr 27, 2011

how can I unite 15 swf files which placed in one folder to a one swf file? i tried all kindes of merging softwares like "Join (Merge, Combine) Multiple SWF Files Into One Software" and "WinMerge" without success and tried to convert swf to flv (cause i found other merging software for flv files) but again.I have CS5 so if i'll have to open Flash for this i will, though i'm trying to avoid that and even then i'm gonna need full instructions.

View 4 Replies

ActionScript 3.0 :: Making Liquid Particles: Two Joining Into One?

Jan 28, 2009

i know i've seen this before, maybe on that flash experimental math site that was all black and white and had a picture of a kid swatting at some molecular looking flies? anyone remember the name of that/well anyway, what i'm trying to pull off here is like a circle of some sort, all of sudden growing a small little circle and then both of them dividing, or possibly, a two circles(modules, atoms, particles) join to be one.

View 2 Replies

ActionScript 2.0 :: Arithmetic Addition; Joining, Not Adding?

Oct 20, 2004

I am trying to add two variables, but my AS is joining them

volume1=function(answer1){
aa=wtft*12;
aaa=wtin;[code]....

There is more to this script, but I cut it down to this in order to focus on the error, which results in a joining aa and aaa. i.e. aa=36 aaa=4 results in a=364, where what I want would be a=40

View 5 Replies

ActionScript 3.0 :: Array Of Variables - Make A Bunch Of Variables From A For Loop

Feb 21, 2009

How can I make a bunch of variables from a for loop. for example for (var i=0; i<total; i++) {var bunch(i);}. that i make a bunch of variables named bunch1, bunch2, bunch3. I keep getting errors. I program and use so many different languages that I dont know if that can be done with AS3. my only other alternative i can think of is to create some sort of event dispatcher object array. but I dont know how to get them all to send events to one listener with there index number.

View 5 Replies

ActionScript 3.0 :: Can't Make Dynamic Variables

Nov 13, 2009

I've been working in a new proyect and i came to this problem that is really getting me tired. I'm supposed to make a given number of items (constructed from an extended Sprite)[code]...

View 1 Replies

ActionScript 2.0 :: Make Arrays As Variables?

Dec 26, 2006

why cant the variable "height" modify the position of y? =S im new at ac so i dont know if an element of an array can be a variable? and how do i make it a variable?this is a par of the code im writing to make a group of movieclips appear offstage in a random positions as long as it is offstage (i know the array is not random since i give the values of each element but i tried by putting y= math.random * number?... but in the coordinates i didnt knew how to specify that it could be any random number exept the lenght of the stage)

onClipEvent (load) {
myArray = new Array ();
myArray[0]=-100;

[code].....

View 8 Replies

IDE :: How To Make Flash Outpur Variables

Aug 6, 2009

I'm new to flash, have some experience with HTML and JavaScript.I wonder if and how I can have a flash object in an HTML page that returns or updates a variable in the page, or assigning it to an input element's text property...for example a flash with a form that upon submission updates the equivalent form in the HTML.(I know I can do it all in HTML, just wondered on how its done...)

View 3 Replies

ActionScript 1/2 :: How To Make ComboBox Write Variables

Nov 27, 2009

I am a dynamic site newbie, but have been making simple animations with Flash for some years. I have got a friend to give me a leg up to create a flash page full of input text boxes that write to a text file via PHP and are then dispayed in dynamic text boxes. [URL]. I want to replace some of the imput text boxes with combo boxes. eg if the combo box has the options of say "rigid" or "trailer" it would write which ever was selected in the text file so this would be displayed in the dynamic text box for the end user to see. It seems very simple but I have looked all over the options for combo boxes and can see no mention of variables.

View 2 Replies

Flex :: Make Objects With Key Names From Variables?

Dec 26, 2009

I would like to make an Object that has key names taken from a variable. Probably this is not clear enough, so let me make an example.

I have two variables var str1:String = 'firstKey'; and str2:String = 'secondKey';

How can I make an object that would look like:

var obj:Object = {firstKey: 'some value', secondKey: 'some other value'}, note that firstKey and secondKey are values of variables str1 and str2.

Doing obj = {str1: 'some value', str2: 'some other value'} does not yield a result that I would like

View 3 Replies

ActionScript 2.0 :: Variables Not Adding Together To Make New Number

Feb 24, 2011

Having some issues with some variables not adding together to make a new number. Instead they are appending to each other as if adding characters onto a string rather than a number. Here is my code.

ActionScript Code:
var dispenserPos:Object = {x1:"41", y1:"180", x2:"283", y2:"180", x3:"530", y3:"180", x4:"775", y4:"180"};
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNum;
[Code] .....

It should be tracing out 388 instead of the numbers appended onto one another.

View 2 Replies

ActionScript 2.0 :: Unable To Make Variables And Buttons?

Feb 7, 2004

I have a movie clip button that has 3 states:up, over, out, and press.the action script inside the movie clip button looks like this:

stop();
onRollOver = function () {
this.gotoAndstop("_over");

[code]....

View 5 Replies

ActionScript 2.0 :: How To Make Decimal Variables Fixed

Feb 21, 2004

I'm making a small game with a timer that have to show the time in seconds with 2 decimals all the time (i.e. 34.71 sec. or 51.00 sec.) How do I force the time-variable to always have two decimals?

View 5 Replies

ActionScript 2.0 :: Make An Externally Loaded SWF And Variables

Feb 25, 2004

I'm tryin to do catalog on CD using flash. There will be 15 pages of items w/ the selections. The coding I'm using for their options is from this: [URL] Now my question is, since I can't use a DB because it's on a CD, I have to pass the variables through flash. But when they are done making all their selections how do I make an externally loaded SWF using this command:

[Code]....

read the final values that were selected on the specified pages? I've read lots of the threads concering passing variables and none of them. Also if anyone knows of any way to hold a DB on a CD and be able to write to it as well as read from it lemme know

View 8 Replies

ActionScript 2.0 :: Make Variables As Instance Names?

Jun 20, 2006

I have created movie clips using loops that names them box1, box2, box3.... via = i + 1;duplicateMovieClip (_root.box, "box" + i, i);but i then want to edit a textbox which is rooted inside each movie but related to the movieclip just produced. so if box1 had just been produced then:box1.textbox.text = " E cell = +j+"V";is done so effectively i am looking to do: box+i.textbox.text = " E cell = "+j+"V";

View 2 Replies

ActionScript 2.0 :: Make Decimal Variables Fixed?

Feb 21, 2004

how to make decimal variables fixed. I'm making a small game with a timer that have to show the time in seconds with 2 decimals all the time (i.e. 34.71 sec. or 51.00 sec.) How do I force the time-variable to always have two decimals?

View 5 Replies

ActionScript 2.0 :: Make A Form In Flash That Has Multiple Variables?

Oct 30, 2009

I am trying to make a form in Flash that has multiple variables, i then want to use a PHP form to send them in an email but can't get it to work. I think that I'm not properly setting up the PHP file for multiple variables:

<?php
$sendTo = "00000@gmail.com";
$subject = "Visitor";

[code]...

View 1 Replies

ActionScript 3.0 :: Parse Html Source To Make Variables?

Jul 2, 2011

is it possible at all using Flash/AS to get the html source code of a webpage and parse it to get some variables from a specific part in the html code..?

View 2 Replies

ActionScript 2.0 :: Variables - Make A Multimedia / Presentation Where Depending On The Options

May 15, 2009

i need to make a little multimedia/presentation where depending on the options you take (normal buttons) a Mc plays and in the end you a get list of itmes depending on the choices you took. I cant remember how to do it, its been a few years since i last did something like this, is there any good tut where i can understand how to do it? cant find anything, basically what i want is to be able to save the choices the user takes during the "game" and with each lode a different .txt at the end. Is this possible with Fl8? its going on a USB Stick, and it'll be a .exe that will load a few swf . . .

View 6 Replies

ActionScript 3.0 :: Make The Timer Fire All Variables In Strict Sequence?

Mar 17, 2010

I'm looking for will all happen in about two or three seconds. I'm re-building my own website using AS3 package classes. When the API loads I want everything to appear in sequence from invisible to visible. First the logo, a few lines drawing themselves, then all the navigation buttons at the top appearing in a quick-fire horizontal row, then the content rolls in, etc. I want strict, accurate control over about two or three seconds, of how and when everything on stage goes from invisible to visible in a quick-fire sequence. I know it can all be done with several timers for each alpha going from 0 to 1. But can all the variables going from alpha 0 to 1 be bundled into an Array? And the Array fired by ONLY ONE Timer using a For Loop? Or am I just barking up the wrong tree? Should I just use a bunch of Timers? I want to avoid a Tween because I want very accurate control of the quick-fire invisible to visible effect. And I want it to be easy to change later. Can this effect be done by ONLY ONE Timer rather than several Timers? And if it can, how do I make the timer fire all variables in strict sequence? Do I use an Array with a For Loop? Or something else? I've been looking for a couple of days but still haven't found anything close.

View 2 Replies

Flex :: Initialize And Make Condition For 2 Variables In Single For Loop?

Oct 28, 2010

How to initialize and make condition for 2 variables in single for loop in Flex let keep i and j are two variables

View 2 Replies

ActionScript 3.0 :: Make A Proper NavigateToURL Sending Variables Using POST Method?

Apr 11, 2012

I really need to send a variable via POST method to an URL and the navigate to it. navigateToURL sends variables using GET method, although I specified POST. URLLoader sends variables using POST method, but does not navigate to the URL.

View 4 Replies

ActionScript 2.0 :: Make A Simple SWITCH Statement With Button._name As Variables?

Jun 18, 2007

I want to make a simple SWITCH statement with Button._name as variables for CASE

so i got this code:

Code:
Button.addListener(_root);
_root.onRelease = function() {

[Code]....

View 2 Replies

ActionScript 3.0 :: Make A Personalized Flash Children's Book - Text Fields And Variables?

Jun 14, 2011

I'm looking for the best way to be able to have a user input their name, age, etc, and then place that data into a Flash Story book, to make it personalized. For Example:Name:_____Age:_____BOY/GIRL:____and then for example if the user decided to Enter: (Cooper, 7, Boy) the story would add those variables, so it might say:"Once upon a time, there as a 7 year old boy named Cooper, who lived in flying shoe."Ideally, I would want to be able to have the text auto format so that it looks like a seamless paragraph, no odd line breaks or spacing issues no matter how long the name they entered was, so for example if they entered "Cooper" or "Cooper William Johnson III", either way the text would still flow correctly

View 4 Replies

ActionScript 3.0 :: Create A SWF And Store User Variables That Control The Playback And Make It All Contained In A Single SWF File?

Jul 12, 2009

I am looking for a class that functions similar to JPEGEncoder from as3corlib, but instead of encoding a JPEG, I want to take a dynamic drawing the user has made (with animation) and output an SWF file that the user can download and playback on his/her computer.I understand how to create an SWF and store user variables that control the playback, but I want to make it all contained in a single SWF file.

View 1 Replies

ActionScript 2.0 :: Make Global Functions Like Global Variables?

Apr 28, 2004

Is it possible to make global functions, much in the same way you make a global variable, reachable from anywhere in the project?

View 1 Replies

ActionScript 2.0 :: Defining Variables - Unique To Load SWFs Instead Of Declaring All The Variables

Mar 21, 2012

I have an empty SWF that's sole purpose is to call loadMovieNum and start the project. Each loaded movie has a few variables defined within them - unique to those loaded SWFs. Instead of declaring all the variables in each SWF can I declare all of them in one place, in the first frame of the empty loader it all starts from? I'm thinking I can then declare a variable which each loaded movie can increment as needed for me.

View 2 Replies

ActionScript 3.0 :: Variables True/false Custom Variables Work In Flash?

Aug 20, 2008

How do variables true/false custom variables work in flash?

For example, what I want to do is create a simple true=false variable that I can call on an if statement later.

For example:

Code:
Var1 = true;
if (!Var1)
{

[Code]....

I noticed that neither the "Var1 = true;" part or the if(!Var1) part worked in flash.

View 4 Replies







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