ActionScript 2.0 :: Create A Grid Of Hexes Using For Loops?

Jul 11, 2004

I'm trying to create a grid of hexagons by using nested for loops. I picked up this code trawling the forums but this creates a diamond shaped pattern of hexes rather than neat rows that interlock together. I want to create one row in the first place, increment the x and y placing coords so as the next row is offset as appropriate to lock it into place under row above. Can't get my head round it. It's been a long day-too much wine-Flash newbie.[code]...

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Creating A Grid Of Hexes Using For Loops?

Jul 11, 2004

I'm trying to create a grid of hexagons by using nested for loops. I picked up this code trawling the forums but this creates a diamond shaped pattern of hexes rather than neat rows that interlock together. I want to create one row in the first place, increment the x and y placing coords so as the next row is offset as appropriate to lock it into place under row above.

This is the code I'm using, which is clearly not doing the trick.

spacing = 35;
spacing2 = 35;
for (x = 0; x < 10; x++){

[Code]....

View 1 Replies

ActionScript 2.0 :: Create A Simple Multiplication Grid Where Children Will Fill The Grid?

Oct 9, 2009

I need to create a simple multiplication grid where children will fill the grid. Its an empty grid at the begining, when they start the time start as well.Its a grid of 10 x 10. when they enter the last number, the grid should show what they did wrong and the time they spend. It's an idea of how it could work but if anyone has something that looks like this.

View 6 Replies

AS2 :: Create Unique Variables In For Loops?

Nov 12, 2010

I'm wondering if it's possible to create variables in a for loop that uses an incrementing number in the variable name.
 
This is the code I've tried (as a long shot) but isn't working:
 
var i:Number;for(i = 1; i < 10; i++){  var ["number" + String(i)]:Number = i;}
trace(number5);

What I'm trying to create here is a series of variables called "number1", "number2", "number3", etc. Is there another way of doing it? I'd need them to be public (I think that's the term?), so they can be used elsewhere in the script.

View 3 Replies

Professional :: Create Unique Variables In For In Loops?

Sep 3, 2010

I have an onEnterFrame function controlling all the movie clips in an array. The motion of each of these movie clips is controlled by a few variables speed, acceleration, etc that are modified on each enterFrame. I can't figure out how to create unique variables for each element in the array. At the moment my variables are the same for all the elements, and so the motions for each movie clip are the same.

I have used this code to add my movie clips into the array:
 
for(i = 0; i < starNumber; i++){ duplicateMovieClip(star, "star" + i, i);  starArray.push(this["star" + String(i)]);  }

Do I need to do a similar thing to create unique variables for each? Or is there something I need to do in my for(myClip in myArray) loop that is contained in my onEnterFrame function?

View 4 Replies

ActionScript 3.0 :: Create An If Statement That Executes Two Different Loops?

Oct 5, 2011

Is there a way to create an if statement that executes two different loops?

For example, If I was trying to make game with a button that when clicked creates random objects falling down and when the objects are destroyed, creates random objects floating up. I haven't seen anything online, but I'm wondering if anyone know. Is it possible or should I just create two different listeners?

View 3 Replies

Flash :: Create Multiple Tab Loops In AS3 By Using Fl.managers.FocusManager?

Sep 7, 2010

I want to create a tab-enabled popup window in an AS3 Air project. Currently, when I press tab several times, the focus goes through all the components in my popup window and then starts focusing the buttons and TextFields from the components that are behind the popup. I have tried to solve this problem in two ways, but none of them worked. I will explain both of the methods here

[Code]....

View 2 Replies

ActionScript 2.0 ::create A Flash Movie That Loops Through 11 Dynamic Images?

Nov 19, 2003

I would like to create a flash movie that loops through 11 dynamic images continually with a fade-in, fade-out each image.

View 2 Replies

Create A Flash Application Where Users Will Have Access To 10, 5 Seconds Audio Loops

Oct 8, 2010

I want to create a flash application where users will have access to 10, 5 seconds audio loops. They can choose any 4 tracks to make a 20 second track. I then want that mp3 to be stored somewhere or flash to create to a file which can be sent to friends in facebook where they can listen to that beat. There will be a little button at the bottom saying 'click here' to make your own beat.

View 1 Replies

ActionScript 2.0 :: How To Create New Row In Grid

Aug 10, 2004

I'm creating a grid and I can place everything in nice columns but how to create a new row.
Code:
var numColumns:Number = 7;
var columnWidth:Number = Stage.width/7;
var numRows:Number = 6;
var rowHeight:Number = Stage.height/6;
var firstDay:Number = 1;
[Code] .....
How do I go about creating a new row in that 'if' statement? I don't want to hardcode any values in there.

View 4 Replies

ActionScript 2.0 :: Create A Movie Clip That Loops And On Each Loop It Loads A Random Little .jpg Banner From A Directory?

Aug 9, 2004

I am trying to create a movie clip that loops and on each loop it loads a random little .jpg banner from a directory. The banners are named 0.jpg, 1.jpg and so on, a script on the first frame of the loop saying

Code:
_root.randomnumber = random(_root.bannernumber);
_root.bannerloop.bannerholder.loadMovie("http://www.url.com/directory/"+_root.randomnumber+".jpg");

"bannernumber" is a variable from an external text file specifying how many random numbers to cycle through (how many banners), This works just fine and loads up a new banner after each loop cycle. The problem lies in trying to make each banner go to its own url, I have another external text document with variables "click0=url, click1=url etc" where I want the number in each variable to equal the randomnumber variable in flash, then use an on(release){getURL(urlvariable)} function to have it retrieve the url that is somehow in the url variable. Basically, how would I make the urlvariable be equal to the "click0" variable to get the url of the click0 variable into the getURL function? while having the number in the "click0" variable be equal to the randomnum variable?

View 2 Replies

Actionscript 3 :: Create A Square Grid?

Dec 19, 2010

I am relatively new to flash. I am trying to create a square grid and add it to the movie.When I open the actionscript panel by pressing F9 and when I type the following code, var square:SquareClip = new SquareClip();addChild(square);

Things are working fine (the squareclip is appearing in the movie). Instead when I do this however, I deleted the above code and just create a new instance of Main,

[Code]...

View 2 Replies

Actionscript :: Create A Grid Of Boxes?

Jun 18, 2011

This is my current code:

_root.createEmptyMovieClip("noteGrid", _root.getNextHighestDepth());
for(i = 1; i <= 14; i++){
currentBlock = _root.noteGrid.attachMovie("block", "block" + i, _root.noteGrid.getNextHighestDepth);
currentBlock._x = Math.floor(i / 7) * 25;
currentBlock._y = (i % 7) * 25;
}

I have a movieclip with linkage set to block. When I compile this, the block appears however they are all on top of each other. When I used trace commands to find currentBlock._x, they are the correct values.

View 1 Replies

ActionScript 2.0 :: Create An Editable Grid?

Oct 29, 2004

I'm having problems creating a grid that will change individual movieclips' frame when rolled over when the mouse is down. My script seems to be acting erratically, when I push buttons, all of the mcs change even though the code to change them is onRollOver.[code]....

View 12 Replies

ActionScript 2.0 :: Create A Grid With A For Loop?

Feb 8, 2006

Let's say I have a movie clip of a square in my library and I want to use a for loop to create a 10x10 grid of those squares. How do I approach that?

Spacing each square horizontally or vertically isn't a problem for me but I'm hung up on how to add 10 squares and then start a new line.

View 7 Replies

IDE :: Create A Grid Containing Pixels In Flash?

May 10, 2009

How can we create a grid containing pixels in flash . for example A square contains a matrix of 4X4 pixel grids and these gids must be visible like sudoku board.

View 1 Replies

ActionScript 2.0 :: Create A Grid Of Boxes?

Jun 18, 2011

I'm trying to create a grid of boxes with actionscript. I have a box, with linkage set to block.

Code:
_root.createEmptyMovieClip("noteGrid", _root.getNextHighestDepth());
for(i = 1; i < 14; i++){
currentBlock = _root.noteGrid.attachMovie("block", "block" + i, _root.noteGrid.getNextHighestDepth);
currentBlock._x = Math.floor(i / 7) * 25;
currentBlock._y = (i % 7) * 25;
}

However, all the boxes are at the same position. When I add trace(currentBlock), I get _level0.noteGrid.block1 ... , however when I do trace(_root.noteGrid.block1) I get undefined.

View 1 Replies

ActionScript 2.0 :: Create A Loop Which Generates A Single Series Of Sine Results Ranging From 0 To 1 Based On 100 Loops?

Jan 20, 2006

I'm trying to create a loop which generates a single series of sine results ranging from 0 to 1 based on 100 loops ( ie 0 ,0.011 ,0.1111........up to 1 in a single run)The results I want start at 0 and increment in a series up to 1 and then stop. I suppose this would be one half of a sine wave I have tried the following but it goes from 0 to 1 ,1 to 0 , 0 to 1 etc whereas I want a single straight run of 100 values from 0 to 1

I tried :

for(var i:Number=0;i<=100;i++){
trace((0.5*Math.sin(i)) + 0.5);
}

This does not work.

View 1 Replies

ActionScript 3.0 :: Create A Grid Where The Users Can 'draw' Across It?

Jun 8, 2009

I'm trying to create a grid where the users can 'draw' across it and change the colors of the grid squares to a chosen color.In the following code, I'm creating the grid with squares. I've got the functionality 'working', but it's only working on the last square instanced.How do I get it to work on all the squares, not just the last one?

Code:
package {
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.MouseEvent;

[code]....

View 5 Replies

Flex :: Create A Data Grid And Use It On A Webpage?

Jul 29, 2009

I want to render a very simple Flex data grid. How do I anchor the SWF flash file in the HTML? Do I need to compile a special .swf or can I use a 'standard' data grid .swf - and just pass the data to it?

View 1 Replies

Flex :: How To Create Overlay In Advanced Grid

Oct 6, 2009

I'd like to know how to create an "overlay" in Flex's Advanced Grid? See the sample here [URL].

View 1 Replies

ActionScript 3.0 :: Create A Square Grid And Add It To The Movie?

Dec 19, 2010

I am trying to create a square grid and add it to the movie. When I open the actionscript panel by pressing F9 and when I type the following code,

Code:
var square:SquareClip = new SquareClip();
addChild(square);

Things are working fine (the squareclip is appearing in the movie).Instead when I do this however, I deleted the above code and just create a new instance of Main,

Code:
new Main
and inside Main.as

[code].......

And when I run the code, my square is not coming.

View 5 Replies

ActionScript 2.0 :: Create A Table / Grid In Flash?

Nov 1, 2006

Am in a need to create a table (looks like a grid) in flash using action script.

View 2 Replies

ActionScript 3.0 :: Create A 50x50 Grid Of 40x40 Pixels?

Sep 1, 2011

I have 2 grid of 15x15 using BitmapData (One of 32x32, and one of 10x10). I've try 2 ways :

1) Create multiple bitmap

[Code].....

Both method works, I was thinking of using a single bitmap will be better for memory performance but if I want to create a 50x50 grid of 40x40 pixels, it will be very huge.

View 2 Replies

Actionscript 3 :: Create A Graph From Points In Grid That Contains Holes?

Jul 6, 2010

I've got a continuous plane (2-D) containing polygonal obstacles. I am uniformly sampling the plane at discrete positions to create a uniform grid of points. The grid does not have points where obstacles lie (i.e. holes where ever an obstacle is) as shown in the image below.[url]...

View 1 Replies

ActionScript 3.0 :: Use AddChild With An Array To Create A Grid Of Movieclips?

Mar 15, 2011

I want to create a grid of movieclips using an array. But every movieclip added needs some sort of unique idenifier so i can access each individual movieclip.

The grid is 6 movieclips on the Y and variable on the X(that doesnt really matter to be honest)

I have managed to create an Array that displays 6 movieclips on the Y using this [code]...

now i tried creating another class and storing the 6 tickets i made in this class in another movieclip and then using the same method in the other class (i called it Ticket_Batch) i created another row of 6 movieclips. although this kind of worked visually i could no longer access each individual ticket.

my question is: how do i create a 6 x 36(or any other multiple of 6) grid of my movieclips in the same class using an array (or 2 arrays) and giving each movieclip an instance name that i can access and use?

View 4 Replies

Xml :: Create A Dynamic Xml Which Populates An Advanced Data Grid In Flex Air Application?

Dec 28, 2009

Is it possible to create a dynamic xml file which changes in some fields to populate an advanced data grid?I have to display continents, countries, society and its values but i want to change randomly only the value and not all toegether...The client side application call the database by an asynchronous httpservice.LCDS, Blaze or similar are not allowed.

View 1 Replies

Actionscript 3 - Create A Grid Layer In Flash And Identify In Which Quadrants Icons Are Placed?

May 19, 2011

I have an existing Flash app that has a layer containing a square separated into 4 quadrants. A set of icons is provided to the user and he/she is asked to drag each icon into one of the quadrants. Does Flash/AS3 provide a way to create a grid (not necessarily DataGrid) that overlays the existing image? If so, how do I setup AS3 syntax to save the quadrant in which an icon is placed?

View 1 Replies

ActionScript 2.0 :: Create A Graphic Effect Of A 90 X 90 Grid Of 5 Pixel Diameter Circles?

Jun 29, 2004

I want to create a graphic effect of a 90 x 90 grid of 5 pixel diameter circles. Is there a way I can create this with just one object duplicated through code? Currently the file is slow due to the number of shapes.

View 1 Replies

ActionScript 2.0 :: Create A Flash Movie That Loops Through 11 Dynamic Images Continually With A Fade-in, Fade-out Each Image?

Nov 19, 2003

I would like to create a flash movie that loops through 11 dynamic images continually with a fade-in, fade-out each image.

View 2 Replies







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