ActionScript 2.0 :: Group Of Squares - One Gets Bigger Others Small?

Nov 6, 2006

I am wondering what that effect is called or how to achieve it where let's say I have 6 squares, 3 on top, 3 on the bottom(2x3 matrix) and where if I click one, it gets bigger, and all the other ones get smaller. The problem here is the how they get bigger. If I click the middle square in the top row, it should stay in it's position and grow where as If If I click the bottom right one, it should grow towards the far left side. I'm guessing the registration point needs to be changed dynamically?

View 3 Replies


Similar Posts:


ActionScript 2.0 :: Rotating Group Of Squares Around Point?

Feb 22, 2007

I'm actually coding this in Java (with which I have just a few days experience), but as far as the logic goes, I thought this would still be an appropriate place. I'm making a Tetris-eque game and having trouble with rotation. Each shape (rectangle, L, "step", etc) consists of 4 or 5 smaller squares (image below), and I want to be able to rotate the pattern of squares 0, 90, 180 and 270 degrees around a designated point.

x = originX + cos(angle) * radius;
y = originY + sin(angle) * radius;

I thought I understood these, but apparently not, since I can't seem to get it working� For each shape, I would declare the x, y coordinates for each of its smaller squares, relative to one another. Then, I'd send these values to a function that should take the pattern and rotate it according to the specified angle. In Java (to the best of my knowledge), the upper-left is always the "registration point" for graphics. So, I set the relative coordinates for the squares of each shape such that the left side of the leftmost square is at x = 0 and the top side of the uppermost square is at y = 0. Here's an example, the shape of a plus sign (+).

Code:
//top-center
x = squareWidth;
y = 0;

[code]....

no rotation (just the shapes)and this is what happens when I implement the rotation adjustment.

View 7 Replies

Flex :: Why Is The Border Bigger Than The Group

Mar 17, 2010

if I place a Border with width and height of "100%" inside a Group with width and height of 10 pixels the Border looks bigger than 10 pixels, why?

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo"
>

[Code].....

View 1 Replies

ActionScript 2.0 :: Server Header - How To Make Small Squares Motion

Apr 15, 2011

I'm work with PS and AI and am a begginer with Flash and currently I'm making this clean cool looking header for a server I play on. This is what it to looks like: [URL]. However I don't know how to make the small squares motion, I want them to "spawn" around the text with alpha slowly growing, not behind the text so it's clean and to move outwards and slowly disappear.

View 2 Replies

ActionScript 2.0 :: Tile The Background Of A MovieClip With A Set Of Small Squares Called Grid

May 9, 2007

I'm trying to tile the background of a movieClip with a set of small squares, called grid. However, the script only attaches on instance of grid. I don't understand why this is. Below is my code exert:

[Code]...

View 1 Replies

ActionScript 2.0 :: How To Use Same Photo For Small And Bigger Picture

Apr 29, 2004

I have a dynamic gallery of images with a small picture that you click on that loads a bigger picture. I would love to be able to just have one photo that loads into the bigger mc and also the small mc. right now what I am doing is making two size photos a small 47x47 and a large141x141. How I can use the same photo for both mc's. If that works will it make the small photos take forever to load since their sorce is a large photo?

View 5 Replies

IDE :: Make Small Logo Progressively Get Bigger?

Mar 4, 2009

I am using a logo in .png form. I would like to have the logo very small at first and then get bigger frame by frame as it goes down the timeline. I created a keyframe on frame 1 and then another keyframe on frame 40. I then made the logo on frame 1 a small size, and I have the logo on frame 40 a large size. I am not sure how to tween them to produce the effect. It won't let me select the "shape" tween. I tried "classic" tween and motion tween (makes you convert to symbols), but no dice.

View 8 Replies

Radiobutton Group Value - Get The SelectedData From The Group?

Aug 14, 2009

I've got some MC's in my library that have radiobuttons in them -- all of this created at design time -- and pull them onto the stage dynamically. My question is how do I get the selectedData from the group? The setup is like this: In a MC called pageOne, I have a group of buttons with a group name of Q1, Q2, etc. I pull the MC onto the stage like this:

[Code]...

Do I need instance names on each of the buttons and add listeners to all of them?

View 4 Replies

ActionScript 3.0 :: Delay Between A Group Of Leaves Falling And Next Group Falling?

Oct 17, 2010

I have some code here for some falling leaves. I was wondering how it can be altered so there is a delay between a group of leaves falling and the next group falling? also to slow down at the end of the fall? [code]

View 9 Replies

Transitioning One Image To Another Using A Grid Of Squares?

Jun 12, 2009

I'm trying to do a transition that you've probably seen many times. Transitioning one image to another using a grid of squares where each square fades at a slightly different time.I've made a complex movie clip made up of several other movie clips with all the squares fading at the rate I'm looking at. When I just play the color squares it works fine, but the minute I turn that master movie clip into a mask for the image I loose the transition/fade completely--just an on off thing.

View 3 Replies

ActionScript 3.0 :: Calculating Pixels In Squares?

Jan 27, 2009

I have a math issue that I have some problems solving.

screen1

screen2

I need to calulate the pixels inside the squares and put them inside an array:

The main square rotates(see screen2) and i have the angle.

Something like attached code.

I have the following values:

- x/y of the main square. ( reference point )

- Width/height of the main square

- Width/height of all the squares

- Angle of main square..

View 8 Replies

ActionScript 2.0 :: Arrange Squares In Column?

Apr 23, 2010

I have a problem with arranging some thumbs in column when I resize the stage. The problem is that it is arranging the last square in line half outside the stage and you can see only a half.

ActionScript Code:
stop();
Stage.align = "tl";
Stage.scaleMode = "noScale";

[code]....

View 0 Replies

Actionscript 3.0 :: Draw Squares With DrawTriangles?

Jan 25, 2010

How do you go about drawing only the outline of squares using drawTriangle. Currently I am using lineStyle to draw my lines but obviously that outlines each triangle. I know i can just draw Squares out using drawRect with no fill but that seems like a waste.

View 6 Replies

ActionScript 2.0 :: Hide Some (most) Of The Squares From View?

Feb 10, 2004

Now I could do with some hints as to how this should be done Hopefully someone will help me out here.

Ok, basically I have a map (a jpg/gif file), which should be divided into squares (like a chessboard). Each square has a coordinate (X, Y) and other pictures should be shown on top of a map square - like a small house or something (also a jpg/gif file).

It should also be possible to hide some (most) of the squares from view - like with a black square on top or whatever. Perhaps Flash should also make some lines between each square to divide them.

Furthermore only a part of the map should be shown through a window (using a mask, I guess) as the map could be large and buttons at the edge could be used to scroll the map.

View 3 Replies

IDE :: Link The Red Squares To The Blue Square In 3D With CS4 Only?

Feb 20, 2009

I would like to link the red squares to the blue square in 3D with CS4 only (please no papervision or sandy...)I'm very closed to the solution but I still have a wrong z (visible when you move the mouse to a corner for instance)

[code]....

The main function is drawLines()

View 1 Replies

ActionScript 3.0 :: All TextFields Displaying As Squares?

Mar 18, 2011

I learned about the date class yasterday and made a lil app that will tell me when the next recess at school will be. It worked great when I ran it at home, but now when I try to run it at school all the letters in the textfields displays as squares, the numbers still work tho. The only difference I can think of is that at home i use CS5 and at school is use CS4, the font is embedded in the fla.

View 4 Replies

ActionScript 3.0 :: Manually Refresh The Page To See The New Squares

May 17, 2011

So far my code takes hex codes out of tweets containing a certain hashtag, and draws a square of that hex code colour. If someone were to tweet a new set of hexcodes while you were looking at the site, you would have to manually refresh the page to see the new squares.

[Code]....

View 6 Replies

ActionScript 3.0 :: Switching Between Painting Ellipses And Squares

Jun 23, 2010

I'm doing a tutorial from Adobe Flash CS4 classroom in a book. They're suggesting the following: "create buttons that allow users to switch between painting ellipses and painting squares". I've created the class files for the cirlcle and the square and I've set two hot keys to switch between painting circles and rectangles(it does not work) Now I'm trying to create the buttons.

package {
import flash.display.MovieClip;
public class Rect extends MovieClip {
public function Rect(w:Number = 40,h:Number = 40, color:Number = 0xff0000) {
graphics.beginFill(color);
[Code] .....

View 1 Replies

ActionScript 3.0 :: Cut Up A Movieclip / Existing Bitmap Into Squares?

Jul 19, 2011

If an image is 800 by 600, copy the image's bitmap data and divide the image into, say, 20 by 20 squares, each having a reference to be manipulated later. Im guessing you have to use bitmapdata for that, unfortunately I dont know how to copy bitmapdata from an image's arbitrary x and y coordinates and for a certain width/height.

View 2 Replies

ActionScript 3.0 :: Fill Grid With Different Size Squares?

Mar 8, 2012

I'm trying to fill a grid with different size squares, randomly, and have no overlap. I want my grid to be 100px by 100px. I've tried creating a matrix array (10x10), holding x and y values. My square size is either 10x10, or 20x20. I loop through the matrix randomly picking a square (x,y position) and placing one of the two squares. All of this works fine, but obviously the squares start to overlap.

This is the type of outcome I'm looking for: I tried adding each square to an array, then checking if the current square placed collides (hitTestObject) with an already placed square. This eventually hits true every time, because the square placed matches the same square when placed in the array. Does anyone know of a way to accomplish this? Place each square but do not have overlap?

View 3 Replies

Actionscript 3.0 :: Using Loop To Create Multiple 3D Squares

Jun 8, 2010

I put together this code that builds a container that contains boxes(squares) in an ordered way. Problem is when I rotate the container, the boxes don't stay in their order. (something to do with swapping depths I think) . In fact, they look a bit confusing. Just create a movieClip 24 x 24 and Name it Box. Create another movieClip and name this one Container. Save them in your library. Then just copy this code and compile. You know the routine.

[Code]...

View 2 Replies

ActionScript 2.0 :: Make Each Of Squares Change Alpha Every Second

Jul 28, 2004

I want to make each of the squares (pictured below) change alpha every second or so. (fading).Is actionscript needed to do this?

View 13 Replies

ActionScript 2.0 :: Shape Tweens - Possible To Draw Squares

Jul 10, 2005

How you draw squares for example in AS (if at all possible) and using shape tweens in AS (again if possible).

View 3 Replies

ActionScript 2.0 :: Creating A Matrix Of Squares With A For Loop?

Mar 14, 2008

I want to create a bunch of squares appear in a grid-like fashion but not row by row. I'd like more of a diagonal effect.

Here's the code I have so far:

[code]...

So this sort of works in the sense of it creates a vertical row and a horizontal row. But I need it to actually kind of 'wipe' diagonally across the page.

View 4 Replies

ActionScript 2.0 :: Minesweeper - Finding The Non-numbered Squares?

Jul 17, 2009

in Minesweeper, if you click on a square that has no mines surrounding it, the game will continually find all of those types of squares and the surrounding numbered squares.

I've had some trouble with this, because I either run into infinite recurrence or...well just a bunch of stuff.I've had a lot of different ideas and ways to do this...but I'm thinking:

1. If the square your clicked on is empty (no surrounding mines) put it into an array.

2. Loop: if the array isn't empty, reveal all surrounding squares, put all unnumbered squares into the array, remove squares previously used.

Code:
function getAmountOfMines(square:Object):Void {
var numMines:Number = 0;
nSquare = _root.gameBoard["Square" + (square.getDepth() - gameWidth)];

[code]...

View 2 Replies

ActionScript 3.0 :: Removed Objects - Squares Inside A Movieclip

Jan 14, 2009

i have many squares inside a movieclip, and i remove random some of this squares, what i need id: get the real with and heigth of my movieclip, after the squares are removed, i do a little exemplo, and anexed here,

[Code]....

View 1 Replies

ActionScript 3.0 :: MovieClip - Mask Image And Get Some Squares To Shine

Nov 5, 2009

I got 1 movieclip, in that movieclip I got 1 image in 1 layer and in other layer I got one matrix of squares. So then when I mask the image I only get only the images by squares. I am trying to had a motion so that some squares shine over the time.

View 0 Replies

ActionScript 2.0 :: Grid - Makes A Big Rectangle Of Smaller Squares?

Mar 14, 2004

I am trying to make a Grid that is equal to the width and the height of the flash movie. I have a movieclip called box which is 30x30, and want it to repead along the x to form columns and along the y to form rows so that it makes a big rectangle of smaller squares. For some reason it looks like this:

+
+
+
++++++++++++++

Instead of:

++++++++++++++
++++++++++++++
++++++++++++++
++++++++++++++

Here is my code:

Code:
onLoad = function () {
boxWidth = box._width;[code]...

View 5 Replies

ActionScript 2.0 :: Drawing Squares In A Clockwise Manner, Using DuplicateMovieClip()?

May 4, 2007

one after the other in a clockwise manner, so that they form one big enclosing square. In my script, I have a square called cell_mc that I would like duplicate instances of cell_mc to enclose to form a bounding box. I would like the duplicate instances to be drawn one by one in a clockwise direction:

ActionScript Code:
// Get depth
var depth:Number = this.getNextHighestDepth();

[code]....

View 1 Replies

ActionScript 2.0 :: Using BitmapData To Create Some Squares At The Required Positions?

May 20, 2007

Working on a new project for a client who requested a content transition similar to the one found on this template (the moving squares one).So far, I was thinking of using BitmapData to create some squares at the required positions .

View 1 Replies







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