ActionScript 2.0 :: F8P: Loading On-screen Points Into An Array With A Loop?

May 2, 2007

I want to make an array that holds objects, each object containing an x- and y-value representing the location of each mc on screen. The mcs will not move. How do I reference each mc using a variable with a loop?

For example, if I have the mcs mc_0, mc_1, mc_2, mc_3, ... mc_49

I want to...

Code:

var n = 50;
var myArray:Array = new Array();
for (i = 0; i < n; i++){
myArray.push(

[code]....

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Loop Array - Gap Between Loading Video?

May 25, 2010

I'm just trying to loop this array, it works, I just can't get it to loop:

ActionScript 3.0 var videos:Array = new Array("videos/movie1.flv", "videos/movie2.flv", "videos/movie3.flv");
var currentVideo:uint = 0;
myVideo.mouseChildren = false;
function playCurrentVideo():void {
[Code] .....

I've found a bunch of threads for AS2, but I just can't get anything to work. Not as important, there's a quick gap between the loading of each video when this runs. Can that be improved?

View 2 Replies

Actionscript 3 :: Multidimensional Array - Loop Of Buttons And Loading Swf/img/txt From Xml

Sep 17, 2011

Okay, here goes: What I'm trying to do is create a multidimensional array which will pull text, swfs, and/or images from an xml file based on which button is clicked. What I don't understand is how to pull the swf or image file from the file like I have with the text. Truth be told, I'm completely lost and could really use some help fixing this. I need to pull text and images or the swf file from the xml depending on which button is clicked and I tried to put this together, but I've given myself a headache trying to understand where I went wrong.

[Code]...

View 1 Replies

ActionScript 3.0 :: Loading Array Vars Into A Button With An XML Loop?

Dec 10, 2009

I built this site out in as2 and have to convert it to as3. It appears the same logic flow and coding just doesn't apply since everything has changed on an event level. The idea is to load thumbnails dynamically and upon clicking the thumbnail retrieve the loaded variable (i) in the array per the XML loop. I'm trying to figure out what I'm doing wrong in logic flow as it keeps coming up "undefined" or pulling up the last one after the whole thing's loaded. I'd copy the exact code but there's a lot of variables. So I'll post this basic structure to give an idea of what I'm doing. The bold print is where I'm stuck in terms of getting a trace.

[Code]....

View 0 Replies

ActionScript 2.0 :: Values On Screen A Points Value And A Budget Value?

Jan 14, 2010

Im wondering if it's easy enough to make a random scenario game?? My idea is you have 2 values on screen a points value and a budget value. And a textbox or field where random scenario's will be. Now depending if the scenario is good or bad, will determine whether your points and budget goes up or down.

My aim is to have 1 month's scenario's to play through but on a week by week basis, so i think they should be a button to play through each week. Ideally within a week i would possibly like 2 maybe 3 scenarios happen so within the textbox could be a summary of scenario's for that week.

And eventually at the end of month there should be a hidden points value to compare your points value with to determine whether you have been success or failure. for example hidden value = 250, and if your points value is lower than 250 then your a failure and vice verse.

This is a bit of an ask i know, but perhaps someone already has done something similar and can pass on there knowledge/code. Or give me an example.

Or if someone is willing to help by putting say an example together for me which i can tweak??

Then rather than 1 month's scenario's change it to maybe 2 weeks, then i can change it for more later.

View 4 Replies

ActionScript 3.0 :: Possible To Set Loop Playback Points

Oct 1, 2008

I know that Flash generally has some very good video support.I am wondering if anyone knows and/or has experience with using Flash video with these types of modificatiions:

- having programic control over the video playback speed. if so, how? is there a simple FPS variable?

- also, would if be possible to slow down the video while maintaining a consistent pitch (tone) of the audio playback? ie.,if we were playing a video of a person playing guitar, we could slow it down to better see the guitar player using their skills,yet hear the song also slower but without modifying the pitch of the notes.

- also is it possible to set loop playback points dynamically? ie, to create a custom interface where the user could set loop points on an entire video that would continue to loop on that portion of the video only.

View 1 Replies

ActionScript 2.0 :: Loading Screen - Stuck Staring At A Blank Screen For A While

Jan 20, 2010

It seems like the loading screen (more like frame) is the last thing to load, so you are stuck staring at a blank screen for a while. How can i prioritize how the game loads so that the instant you get on the page the loading screen comes up immediately?

View 5 Replies

ActionScript 3.0 :: Setup An Array Of Cue Points?

Mar 28, 2011

I'm trying to set up an array of cue points and when each cue point is reached, it triggers an event. I've got the array set up, but am having difficulty setting up the action events.

[Code]...

View 3 Replies

Flash :: Away3d To Render A Surface From Given Array Of 3d Points?

Dec 14, 2010

So I have some 3d points generator that gives points like

{1,1,1}
{1,2,3}
{1,3,3}

[code].....

View 1 Replies

Flash :: Collision And Bounce Detection From Array Of Points

Sep 18, 2011

I have an array of points that I will use to generate a closed polygonal fence on the outside of a game stage (2D). I wish to have collision detection between this fence and a bouncing ball-like object on the inside. Additionally, I would like to be able to arbitrarily add/remove/redraw the fence in realtime and have the collision detection still operate realistically. I have considered drawing a Sprite/Shape from the points and doing a HitTest at each frame to check whether to bounce or not. My question: is this the best/correct way to accomplish this goal? Consider something like JezzBall with diagonal lines of any angle a simulation of what I'm trying to do.

View 2 Replies

Actionscript 3 :: Flash - Create An Array Of Coordinate Points?

Dec 12, 2011

I want to create a simple array of points, representing a clockwise set of coordinates at 45 degree increments, such that the array would be (starting from 12 o'clock):

var coordArray : Array = [
new Point(0,-1),
new Point(1,-1),
new Point(1,0),[code]........

I'm looking for the most efficient way of creating this array (ideally with the coordinates themselves generated through some sort of equation). What's the best way to do this? All I want to do with these is create a coordinate on the stage relative to the clips current coordinate in which to move, based on that clips, such that if the move distance for clips was 50px, and the clip had a depth of 0, it would move 50px in the coordArray[0] position, or 0*50 in the x direction, and -50px in the y direction (0,-1).

View 1 Replies

ActionScript 3.0 :: MovieClip Collision With Points Stored In An Array?

Jun 8, 2011

Im a bit stumped on this. I have a movie clip named mcMain that the player controls, and i want him to have it detect collisions at certain points of the screen (like at a certain X and Y co-ordinates). I have an array that contains those values, which is shown below:

Code:
//Array that holds x position of points
var xPoint:Array = new Array(150,400,200,300,100);

[code].....

View 3 Replies

ActionScript 2.0 :: Creating Array - Called Points Shown As Undefined

Aug 14, 2004

I'm trying to create an array, and this is the code I'm using:
Code:
function create_spiral(len, rad, turns, num, theArray) {
theArray = [];
var inx = len/num;
var iny = ((360*turns)*(Math.PI/180))/num;
var inz = iny;
[Code] ....

And I'm calling it with:
Code:
create_spiral(200, 10, 3, 100, points)
ideally, I would then have an array, called points, which would be full of numbers. But when I run a trace it shows as undefined.

View 2 Replies

Actionscript :: Assemble Array Of Continuous Points For A Contour Line Using Conrec

Mar 31, 2011

I am trying to implement contour lines in ActionScript using Conrec. I have looked at both the java and javascript implementation and am still stuck.URL...Conrec will take grid data and assemble continuous contour lines. The problem is that it does not necessarily draw those lines in a continuous fashion. For example, it will draw A->B and then C->B and then C->D instead of A, B, C, D, etc.The javascript implementation seems to be accounting for this and serializing the instructions into an array of draw points. Which is what I too want to accomplish in the end. That is it takes the instructions from the core Conrec logic (eg: A->B, C->B, C->D, etc) and organizes it into an A, B, C, D series. I think it will also return the series as a multi-dimensional array to accommodate broken lines (eg: [[A, B, C, D], [E, F, G]]). This last functionality is what I need to do in Actionscript.This last part is where I am stuck. Ignore Conrec for now (I have given up on finding an Actionscript implementation), how can I organize these instructions into a collection of serial points? When Conrec gives me "draw point from X->Y" how can I first check if X or Y are already in a series and append either X or Y (whichever is not in the series) into the series? AND if neither are in the series, start a NEW series with X, Y as the starting set. Then check subsequent instructions against all existing series and connect series if they now start and stop on the same point? Also, I need to be able to allow for a series to close itself (eg: A, B, C, A) -- a loop (is that even possible?!).

I'm not sure if there is a technical term for what I want to do beyond "concatenation". I also hope someone out there has done this with Conrec and can give me some pointers.In the meantime, I am going to continue to plug away at this and see if I can come up with something but I am not confident in my abilities.If you know another way to draw contour lines from grid data, I am open to alternatives. But I have to be able to implement it in Actionscript.

View 3 Replies

ActionScript 3.0 :: Loading External Assets - Screen Stops Until The Loading Is Finished?

Oct 11, 2009

I have a movieclip clip that plays when the movie starts, the movieclip is a visual assets that show's that the application is loading some information but it's not showing any loading progress, just playing while the assets are loaded.I created a for loop that will load the assets using a simple loader, and then when the object is loaded the application push the object to an array.Problem is that when the loading starts all the animation that i have on screen stops until the loading is finished.The whole point is that the animation will play while it's loading.

View 10 Replies

Loop Through An Array And Use The Array Value To Reference A Variable?

Sep 25, 2009

I want to loop through an array and use the array value to reference a variable.

The Setup:
(For illustration only. Not actual script)
My MCs:
triangle_mc
square_mc

[Code]....

View 1 Replies

ActionScript 2.0 :: For Loop To Check One Array Against Another Array?

Aug 25, 2011

ActionScript Code:
var answerArray:Array = ["3", "2", "5", "3", "2"]; //these are the correct answers
var answeredArray:Array = ["3", "1", "1", "3", "2"]; //this is an example of what the user

[code]....

View 3 Replies

Actionscript 3 :: Calculating Evenly Distributed Points On A Line Of Points

Oct 3, 2011

I have been tasked with trying to create a drawing tool that draws dotted lines as you drag the mouse across the stage. I can easily capture the points on MouseEvent.MOUSE_MOVE and store them in a vector and then draw the points as dots:

The problem is that I need to calculate evenly distributed points on an ever growing Vector of points so I can only draw the line between say every 5th point (say using modulus). I have been battling away with Bezier curve equations both Quadratic and Cubic but still can't quite figure out how to convert my Vector of points into an evenly distributed Vector of Points without sucking the life from the CPU.

View 1 Replies

ActionScript 3.0 :: Character Zooms Off The Screen When Put A Loop In?

Mar 17, 2011

My code allows you to be able to move your character the arrow keys, I put a loop in so that the character will move a lot more smoothly. but with this loop in my character just flys of the stage when i run the application.

[Code]....

View 1 Replies

ActionScript 3.0 :: Updating Screen Elements In A For Loop?

Aug 10, 2011

I have a for loop that, among other things, contains an appendText command.  It adds a character to a text box on the screen.
 
I notice that rather than append the text on each iteration, it waits until the for loop has finished, and then appends all the characters.
 
It's not noticable on short loops, but very noticable on longer ones.
 
Is there a way to make flash update the text box as each iteration happens, rather than dump all the appended text at the end?

View 7 Replies

ActionScript 3.0 :: Fill Screen With Pattern Through A Loop?

Sep 3, 2009

I'm filling the stage with a symbol to create repetitive pattern

ActionScript Code:
function patternFill():void {
var patternBox:Sprite = new Sprite();

[code].....

View 2 Replies

ActionScript 3.0 :: Using "this" And Loading An XML File In Which Each Record Points To A Small JPG For A Thumbnail

May 27, 2011

I'm loading an XML file in which each record points to a small JPG for a thumbnail and a larger JPG I'd like to display when the thumb is clicked. Stumbeld upon a cool way to use "this" to keep code tight. But now I can't figure out how to refer to each corresponding image that is loaded into each "big loader" when it's thumbnail is clicked.

I was thinking of initially setting the alpha of the big image's sprite (bgSp) to 0 and changing it to "1" when the thumb is clicked (smSpr). (Would be loading a lot of stuff initially, but the big images would show up FAST when a thumb is clicked). But I can't figure out how to specify which big sprite corresponds to each small sprite. Here's what I've got so far:

[Code]...

View 5 Replies

ActionScript 3.0 :: Add MC From Array Onto Screen?

Jul 7, 2009

I have a series of movie clips stored in my library (which I have exported for ActionScript and classed it img01, img02, img03), and I have placed them into an array. I then tried to add the movie clips from the array onto the screen, but Flash gives me the error "1064: Type was not found or was not a compile-time constant". I figured it is because it does not like my array.[code]...

View 2 Replies

ActionScript 3.0 :: Make Only One Array Appear On Screen?

Nov 12, 2009

I have a multidimensional array, and my arrays are joined together to an array arrGrid. I want to randomly show one of my arrays from my list arrGrid. So far I have the randomizer, but it goes through them all and stops at the very last name in my array. I want to be able to stop the array from randomly going through them all, and just show one at a time.

stop();
var arrGrid:Array = new Array; // master array that holds arrays
var arrname:Array = new Array; // all the names
var arrcontainer:Array = new Array; // all the package types

[Code]....

View 1 Replies

AS3 :: Loading Screen On IOS & Android?

Apr 11, 2012

I am building a book application in Flash Professional CS5.5 to be released on tablet devices and I am trying to understand the best structure for loading the application. For iOS devices I know I can include the default.png, but how can accomplish a similar task for Android? The book application is also going to be large as it includes a lot of assets and animations, is there a good way to show that this is loading on both platforms?

One thing I was trying was a loading screen where the main application was actually a loading system that would import the compiled SWF book, but further research shows that it won't work for iOS devices.

View 1 Replies

Professional :: No Loop In Swf Array?

Jan 20, 2011

I have this flash movie I've been working on for awhile. I've received in these forums. I have my file set to load an array of swfs.  Now, though, I'm wondering how to keep it from looping.  At the end of the last swf, I want the movie to go to the last swf and then just stop.  Here is my code:

[Code]...

View 9 Replies

Use For Loop With An Array And AddEventListener?

Nov 11, 2009

I have this map I'm creating in Flash. You click on a state, then you can click on an icon to view a tooltip/popup of some information. What I was trying to do was instead of creating new functions and event listeners for every different icon is to use a for loop...but it's not going so well.[code]...

View 2 Replies

ActionScript 3.0 :: SWF Array - How To Get It To Loop

Jun 21, 2010

I've a container file which loads an array of SWFs. The code is as follows:

var request:URLRequest;
var loader:Loader= new Loader();
stage.addChild(loader);
var myMovies:Array=["../flash/movie1.swf","../flash/movie2.swf", "../flash/movie3.swf"];
var movieNum:int=0;
var mcExternal:MovieClip;
[Code] .....

This works fine - the array is loaded and plays through once... What changes are needed to get it to loop through the array.

View 2 Replies

ActionScript 3.0 :: Set An Array By Using A Loop?

Oct 6, 2010

how can i set an array by using a loop.. the array is contains by a data that i read from database.. so the length of carry depend of the length of data in my database..

i try to use
for (var i:int = 0; i < xxx; i++) {
products = [p[i]];
}

i never read data from database in as3.. so if i want to use the data in database for this loop,what should i do?

View 2 Replies

ActionScript 2.0 :: Run A Loop In An Array?

Feb 16, 2008

if you could run a loop in an array?

I'm having to make an array that has each value increase by a 10, like 10, 20, 30, etc. is there an easier way to put in those values without adding them 'manually'?

and I have another question that is related. For this same project, on the stage there will be a text box and the user will put in a number--how can that value be run through the array? like say I input the number 500, how does it find it in the array? is there a passed id, a listener and a broadcaster?

View 2 Replies







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