ActionScript 2.0 :: Flash8 Using Arrays For More Than 1 MC

Oct 10, 2009

i'm trying to use an array to attach up to 4 movie clips, using the same script. My code I'm using to attach looks like:

Code:
if(en<=4){
EA[t] = attachMovie("enemy", "enemy"+t, depth++);
EA[t]._x = random(300);

[Code]....

This part works fine, but what doesn't work is the script I try to add to the movieclips. If i add EA[t]._x += 10, then only the lastly created enemy moves. How do i make it so that all of the enemies move?

View 9 Replies


Similar Posts:


ActionScript 2.0 :: Flash8 : Search Multiple Arrays For A Value?

Feb 26, 2009

I am attempting to search multiple arrays (over 300) for a specific value which will then determine if that question is to be loaded. I have used these over the years as the quizzes simply loaded questions randomly. Now I am appempting to move this into a computer adaptive test format. I have most everything worked out except for this part which is the key to the project.

What I have is 300+ arrays like the ones below. Once a student answers a question either correctly or incorrectly a difcal value is assigned. It is that value I need to search for to determine which question to load.

For example if the student answered a question incorrectly and the difcal was calculated as -4.03 (difcal values are always in array element[0]) I would need to search the all arrays to find that value and then load that array into the question function.

Code:

var q1:Array = new Array();
q1[0] = -4.03;
q1[1] = 0.57;

[code]....

View 2 Replies

ActionScript 2.0 :: Flash8 Strings, Arrays, And Splitting Errors

Jul 18, 2009

the general goal I'm going for is this: user enters a bunch of text into a textarea. It's parsed word by word into an array, and then the array is gone through. If a certain word (from a list provided by me) is found in the array, then an event will happen later..

[Code]...

View 5 Replies

Arrays :: Flash - Pushing Or Adding Arrays As Values Into A Multi-dimensional Array?

Jan 21, 2011

I am running into some trouble adding an array into another array to create a multi-dimensional array.The code appears as below:

var slideDataArray:Array = new Array();
var slideShowDataArray:Array = new Array();
slideDataArray[0] = xmlData.SlideShowParameters.SlideShowImagesDirectory;[code]........


I am looking for a means of placing the slideDataArray into a 'slot' or value of slideShowDataArray so that I can in the end pass the slideShowDataArray as a parameter to another function.As of now, the last slideDataArray appears 11 times (the loop runs 11 times) in slideShowDataArray and the way the code is written the slideDataArray is unique every iteration of the loop.

View 1 Replies

ActionScript 3.0 :: Arrays Of Arrays / Data Providers And Dictionarys

Aug 26, 2009

I've got a bit that loads a big chunk of xml data about products.I push product info into an array(e.g. productArray), then add that array to another array (e.g. allProductsArray)How do I sort those arrays? For instance, if I want to sort the allProductsArray based on the info in productArray[0]?Alternatively, would something other tha an array of arrays be a better route?This loader loads the same sort of info for many different clients, so the bit to sort on will change.

View 5 Replies

Arrays :: Fastest Way To Merge Multiple Arrays?

Sep 26, 2011

I'm trying to write a function where I can specify any amount of array, and the return value will be an array containing the contents of all of the specified arrays.I've done this, but it seems like a really slow and ugly way of doing it:

var ar1:Array = [1,2,3,4,5,6,7,8,9];
var ar2:Array = ['a','b','c','d','e','f','g','h'];
function merge(...multi):Array[code].....

Is there an inbuilt and more efficient / nice way of achieving this? The result does not need to be in the same order as the input - completely unsorted is fine.

View 3 Replies

ActionScript 3.0 :: Randomizing The World! Arrays And More Arrays?

Feb 17, 2009

A little explanation: Im making a random arranging number Array. So instead of using a loop and assigning 0 to first array element, 1 to second, etc.I need to make it totally random but without repeating any numbers. To do that I made a second Array that will have the same number of children to serve as a reference.Each of them will be an Object with a property "num" , wich will be its actual number, and a property "called" wich defaults to false.Like this:

ActionScript Code:
for(var i:int=0;i<vQuantity;i++){
ranArray.push( new Object() );

[code].......

View 8 Replies

ActionScript 3.0 :: Arrays Store References Of Other Arrays?

Dec 27, 2009

I've had a problem for awhile that was really odd. After some intense debugging, I realized the problem lied in setting an array equal to another array.[code] When setting one array equal to another, the values aren't copied over, but a reference to that memory is stored. So no matter which variable you change, they are both references to the same memory and thus both will reflect the changes.With other data types, this doesn't happen.I could fix it by looping through t1 and using push() to add each index from t1 into t2, but that seems a little messy.

View 7 Replies

ActionScript 2.0 :: Pushing Variables To Arrays Within Arrays?

Jun 25, 2004

correct syntax for pushing variables to arrays within arrays? I have searched many threads but found nothing that exactly answers my query.I have a class (Brigade) which amongst other variables contains an array (BrigadeUnits) This is the third element.. My Brigades are stored in an array called AllBrigades. I now need to fill the BrigadeUnits array with objects of my Units class.The hierarchy I want to create is as follows:

AllBrigades (array of Brigades)
Brigade (object)
BrigadeUnits (array within Brigade object)
Unit (Object to be stored in BrigadeUnits array)

I have tried various approaches including the following, assuming that I am addressing the first Brigade in the array:

AllBrigades [0] [2].push (MyUnit);

But when I trace this I just get undefined.

View 14 Replies

Flash8 New Kid On The Block?

Apr 17, 2009

I maintain two web sites and am reasonably competent in Dreamweaver and Fireworks. Now to get into Flash.I want to produce a banner which shows a flag + Welcome in that language and have about 20 nations to cover. Can anyone please point me to a guide as to how to get this started?

View 1 Replies

Flash8 :: Go To Frame If Key Is Down?

Feb 19, 2010

I have two frames in a movieclip with a stop in the first. I want a script that makes is so that when you hold down the UP or DOWN arrowkey it jumps to frame 2 but if you drop the UP or DOWN key you go back to frame 1.

View 1 Replies

Flash8 :: Variables That Can't Go Below Zero Etc

Aug 4, 2010

just getting the grip around the variables and im experimenting. This is what i have as a variable

money = 1000;
health = 100;

Then i have the dynamic textbox that shows them. works great, and i also have various effect that makes the two go up and down. Here's the problem, or more, how i would like to expand the concept but is stuck on. Right now both variables can go as high and low as possible (of course). Is there something i can add in that script that makes so the money variable can't go below 0. Also is there something i can add so that the Health can't go ABOVE say 500 and when health reaches zero (or a negative) this triggers _root.gotoAndPlay("gameover"); you get what im trying to achive here

View 15 Replies

Flash8 :: Seeing All Layers In Animation?

Mar 13, 2009

I am trying to make an animation in which different layers (=images) come into the stage, then stay in place and other layers move in and stay as well. I have done 2 of the layers so far, converted them into movie clips, tweened them etc. When I run the cursor along the timeline, I see the desired result on the stage, ie everything comes in at the right time and stays in place. However, when I export it to view the film, only the first layer comes in, moves into place and stays there, and then nothing happens, ie the second layer never comes in.

I've tried everything I can think of, moving the layers around etc, and have deleted and redone the whole thing many times in an attempt to fix this, but I simply don't know what is wrong.

View 4 Replies

Flash8 :: Blank When Exporting To .avi?

Mar 25, 2009

So I made an animation a while ago and exported it no problem as an .avi. Recently I've needed to make changes, but whenever I try to export it, it is a blank video.

There is no sound, so I'm not sure whether or not that is working, but the video turns out as just a black movie with the proper length.

When I test it in flash or export it as a .swf, it is fine, only the .avi is the problem.

View 1 Replies

Flash8 :: Adding The Cut-Out Shapes?

Apr 15, 2009

it is possible for me to add cut-out shapes onto Flash? I have cut them out in photoshop and pasted on a transparent background, but when I open them in Flash the background has changed to white.

View 1 Replies

Flash8 :: SCROLL Keeps ROLLing On

Apr 21, 2009

I have a scrolling image. Like the speed, like everything about it except that the image keeps panning out of sight on either side never to be seen again! What to Doooo??

View 3 Replies

Flash8 :: Stopping The Map At Impact

May 10, 2009

Basicly its simply a world map with a character in the middle. You move around with the arrow keyes (in reality you move the map around and the character stays in the middle) and at certain impact you walk into houses etc etc. To accomplish this i have a movie clip in the middle named "man" and a map movie clip beneath it with the following code:

[Code]...

So far so good and no problems. This is what i need help with: I can't seem to get the "main" map to stop moving at certain points when it impacts the "man". In essence there are lakes and mountains that the character cannot cross when when he hits these i want the speed X to be 0 so to say. Im uploading my example here. It's when the movieclip in the root named "man" hits the purple line in the map movieclip its speed should go 0. Ive tried around with hittests (the code is still in the code) but i can't get it to work.

View 21 Replies

Flash8 :: Put Variables In An Array?

May 31, 2009

Is it possible to put variables in an array?

For example:

Code:
var positions:Array = new Array(Stage.width / 2, Stage.height / 2);

When the above code is executed, the values "Stage.width / 2" and "Stage.height / 2" are replaced with the number values and the array becomes, for example [500, 400].And when I call the array positions[0], instead of getting the value of the Stage.width / 2 (considering the stage has been resized), I get the static value of 500.What can I do to get the value of Stage.width / 2 ?

View 1 Replies

Flash8 :: Can't Load This Swf Into Flash

Jun 5, 2009

i have a fla file in Flash 8 that i use for content center...and i'm trying to load a swf (some photo and text AS3) into it... but it just doesnt want to work... i have tried loadmovie, loadmovienum, none seems to work, the swf file is just not working the content file is working, its the preview.swf that is not,

View 2 Replies

ActionScript 2.0 :: Flash8 Load Txt To Url?

Jun 15, 2009

I have a textfile called link with an url-address. I want to load that textfile and have that url instead of "goal" in this code.

knapp.onRelease = function(){
getURL(goal,"_blank");
}

View 10 Replies

ActionScript 2.0 :: Flash8 FLV To Play Only Once?

Aug 24, 2009

I need the FLV to play only once when a MC is loaded.

When the FLV is still playing, I want it to stop playing when click on any button..

PHP Code:

stop();
// Flash 8, AS2
import mx.video.*;
var flv1:String = "flvs/DrJoy_corner_KevinIntro.flv";

[Code].....

View 2 Replies

Flash8 :: Fit My Webpage On Any Screen?

Oct 6, 2009

I have designed a website in flash. I tried all the file resolution size like 1024x768 or 800x600 or even 1000x600. Whatever size it is, the webpage doesnt fit on my monitor. Either it is too small or very big.Also I dont want to see any blank white space. How will I fit it exactly on all monitors?

View 2 Replies

Flash8 : Collide With Only One Layer?

Dec 2, 2009

I'm using Flash 8, and I'm hoping to work on a platforming game. I'm pretty familiar with programming in general, but Flash is a little confusing for me.What I have at the moment kind of works for generic collisions, but my problem is that it works too well. My player symbol collides with absolutely everything, on every layer, even including text.

Right now my file only has two movie clips, Player, and Bounds, and there's an instance of Player named player_1, and an instance of Bounds named Wall.

For collision checking, I used the following if ( _root.Wall._parent.hitTest( ... ) ) { /*do stuff*/ } and this works well enough, I collide with anything, given that I check in the right place. I'm happy with the way that this works, but is there any way I can confine the collisions to the layer the symbol is currently on? I'd like to design the levels, and just draw the foreground graphics on the layer above, and the background graphics on the layer below.

Using trace, _root.Wall._parent returns level0, which I'm going to guess is maybe the scene? I'm assuming collisions aren't really meant to be handled this way, so if I have to totally redo them, I'll understand, but it would be most convenient for me if I can confine the collisions to only a single layer.

View 18 Replies

Flash8 :: Swfobject - Can't Resize It?

Dec 28, 2009

Here is myattempt at using swfobject and alternate content:

Code:
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>[code]........

I seem to be getting closer to this, but I can't get it to NOT resize the swf!

View 4 Replies

Flash8 :: Achievements Appear Once Not Working?

Jan 18, 2010

I'm making an game which i want to intergrate acheivements, I've got everything working to an extent but I've isolated code and put it in a test to show my problem. I have a MC called "ach" (without ") and inside that i have another MC called a1 , a2 , a3. They are animated to disappear after say 45 frames. I've put my acheivements on buttons just to test them, but in my game you get them for say playing for 1 hour or collecting all items and some for clicking hidden buttons etc. but when I click the buttons again the acheive MC keeps appearing. I only want it to appear once.This is the code I have got that doesnt work.

Button Code :

Code:
on (release) {
_root.ach.gotoAndStop(3)
}

[code]....

View 1 Replies

Flash8 :: XML Works, But Not In HTML

Jan 27, 2010

I have created a program that pulls large amounts of data from an XML file. The program works absolutely perfect if I test it in Flash or open it in IE. The problem I have run into is that when I put the program into a webpage using the following code (neither one works), it no longer connects to the XML file. Am I missing something in the code?

PHP Code:

<object width="880" height="800">
<param name="complete_bikes" value="flash/complete_bikes.swf" />
<embed src="flash/complete_bikes.swf" width="880" height="800">
</embed>

[Code]....

View 3 Replies

Flash8 :: Number In Text Box?

Jan 29, 2010

i am trying to make a banking system, i have a text box which is called totaltxt, the number is currently set to 0, i press a "50" button, and the total should be 50 right?....but im getting 050 instead,heres my code, i am using AS2 btw

PHP Code:
var bank:Number;
bank.valueOf(totaltxt.text)

[code].....

View 2 Replies

Flash8 Preloader Broken?

Feb 7, 2010

OK In a previous game on the same AS (2), I made a preloader, the code worked fine, all of the code was isolated on one frame so on another game I copied the frame and pasted into my other game. but the only difference is that one of my games is using flash player 8 (working preloader) and the other is using flash player 6 (not working.) Im using the same code.here is the frame code (all of it on frame):

Code:
var loadingCall:Number = setInterval(preloadSite, 50);
function preloadSite():Void {

[code].....

View 2 Replies

Flash8 : Using Variables Over Timelines (AS2)?

Feb 11, 2010

My variable from the root timeline is not being sent to say a timeline inside a moveclip. This is basically my code:

On root timeline:

Code:
stop();
showred = false;

Inside movieclip instance 'infobox' on timeline:

Code:
stop();
if (showred == false){
play();
}

the showred variable inside the 'infobox' movieclip is not detecting that I set 'showred' to false on the main timeline.

View 2 Replies

Flash8 Sharing Art Across Files?

Feb 16, 2010

How would I set it up so that I can share a single piece of art across multiple files? My goal is to arrange it so that I can edit the art in the original file and automatically update the art in all files linked to it when published?

For example, I'm working on a character animation where the character appears in many episodes and the episodes are split into many .fla files. If I needed to change the appearance of the character in all of the episodes which are spread across many .fla files, I would I have to do it manually?

View 3 Replies







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