Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Random Squares Preloader



I'm having issues with this. I am making a preloader in which as it loads, random squares lose their visibility to reveal a picture. I have squares named "clownjewmask1" all the way up to 399. I had this written out and I'm trying to get it so that only squares randomly generated disappear. the "square" variable is a random number from 1 to 399. This is the only line I'm having trouble with:

["clownjewmask"+square]_visible = false;



FlashKit > Flash Help > Flash MX
Posted on: 08-22-2005, 08:06 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Random Disapear Of Squares
Hello,

i have 30 squares in my site. I also have a function which fades out a MC. I want to fade the squares one by one in a random way.

for fading i use the command square01.fadeOut(speed, limit);

So how can i fade out the 30 squares in a random way?
i tryied a loop for and random command but i wasn't able.

Thanks,
Miguel

Random Colored Squares
Hi everyone, i dont know if this is the right forum where i should ask for help, just correct me if i wrong anyways i want to create a random colored squares as my transition for movie clips, like before i show movieclip2 i should play a transition first before showing it. The concept would be random colored sqaures moving around the scene like changing places or something. If you'll look at http://www.orangedesign.com when you click one of the window(ex. contact us) before you'll see other stuff a transition is being played, a randomed color squares which moves around, i think randomly also.

Any help or advise will surely be appreciated

Random Squares Fade Out
does anyone know whats wrong with my code?

code:
multiSq = [square0,square1,square2,square3,square4]
rNum = random (5);
for (i = 0; i < multiSq.length;++i){
square[rNum].ealpha = 0;
}


im trying to make squares romdomly fade out one by one untill they are all gone can anyone help me?

this is the code i have on the squares:

code:
onClipEvent(load){
_alpha = 100;
ealpha = 100;
speed = 5;
}
onClipEvent(enterFrame){
_alpha += (ealpha - _alpha)/speed;
}

Random Moving Squares
Found this flash sample and i can't figure out how to do the random and continuous dancing squares.

I just think that its a random, continuously scrolling image

http://www.mix-fx.com/balancedshakecasual.htm

It's pretty similar to the link summary from kirupa.com found on top of each link page such as this:

http://www.kirupa.com/developer/flash5/home.htm

without the mouse cross

BTW, i'm using flash 5 right now

How Can I Make Little Squares Glimmer With Random Alpha?
Hi im trying to make grid of about 100 little squares (5x5 pixel) which are on there own layer flash independently of each other by giving them a random alpha value which changes. it will give the grid a kind of glimering appeal. i want to be able to control the range of minimum and maximum alpha and i want to be able to control the rate of change between each state so that it can be quick or slow. also i want it to fade between the random alpha transistion so that it fades between each random value smootly.

i have animated each square to do something specific in the intro and then i want to apply this action script to each layer for the rest of the time line which will be on a loop back to the start of the action script section.

this is a component which i will load into my main fash file as a .SWF with a load movie function

Im new to flash and i hope im not asking to much here. im using flash 8, if you can tell me how to do any of the above i would be gratefull as i would love to get going with this and knowing some of the above functions are better than knowing none!!!

Does anyone know how to achieve this with action script?

Thank you in advance!

Squares
HI ..


I have a simple idea i want to do , i know that some one make it before.

i want to make a square - as a button - when you click on it all the screen will be coverd by squares (but not in a random way ) .


Any idea ??

Squares
Hi

any tutorials out there on how to create shuffling squares like on the digisoft studios website..or does anybody themselves know how to do it.

thanks

Squares
can somebody tell me how to add squares when is loading image like on this file
http://members.lycos.co.uk/xmalsiamusicx/header.swf thanx in advance

Sliding Squares Nav.
I've been trying to figure this out but I can't seem to get it right.. if anyone can help, PLEASE post a message.
I need to know how the shifting squares on this website work.
http://www.eskedahl.se/
thanks so much for your help.
erick.

Strange Little Squares
I'm testing an interface in flash mx where user can update his data through cold fusion and access db. Everything works fine exept that i always find little strange square symbols within updated data inside dataBase. So far I wouldn't mind 'cos the user gets his updated data back to the same interface without "squares" (unless it's ã or ê!!-why?). BUT, when it's about changing password of course we have a problem there, 'cos data base actually contains more characters then user has inputed. Thus the access is denied. How to GET RID OF SQUARES !!!!

thx
Alek

HitTest Squares
Hello! I am making a game and am having an issue with some hitTests... The main character runs around and theres plenty of things to run into that make him stop using:


Code:
if(_root.player.hitTest(this)) {
if(_root.player._x < this._x) {
_root.player._x = _root.player._x - _root.movespeed;
}
if(_root.player._x > this._x) {
_root.player._x = _root.player._x + _root.movespeed;
}
if(_root.player._y < this._y) {
_root.player._y = _root.player._y - _root.movespeed;
}
if(_root.player._y > this._y) {
_root.player._y = _root.player._y + _root.movespeed;
}
}
^ That code is in the MC he is running into.

The only problem with this is that for non square shapped things... hes running into an invisible square around the odd shaped thing. Is there a way to make the hit test check to make sure he's actually hitting an object and not just the box around it?

Also another problem with that code is that if you hold down the arrow key to keep running into the object he will be pushed up and down along the side.. I can see why it does that but I don't know how to fix it, any ideas?

Thanks

Rotating Squares
Hello.

I would like to create a square (in Flash MX), that rotates on it's X and Y axis when the mouse rolls over it.

Specifically, I would like to have a single colour square (blue for example) and when the mouse touches the left or right side of the square it rotates horizontally, and if it touches the top or bottom, it rotates vertically. I would also like the other side of the square to be a different colour.

I'm sure this is possible, but I have no idea how to do it! Any help would be greatly appriciated.

Thanks

Rotating Squares
Hello.

I would like to create a square (in Flash MX), that rotates on it's X and Y axis when the mouse rolls over it.

Specifically, I would like to have a single colour square (blue for example) and when the mouse touches the left or right side of the square it rotates horizontally, and if it touches the top or bottom, it rotates vertically. I would also like the other side of the square to be a different colour.

I'm sure this is possible, but I have no idea how to do it! Any help would be greatly appriciated.

Thanks

Squares Animation
Hi. Can someone help me with an animation I'm working on?

Basically what I’m trying to do is make random20x20px squares appear and disappear with random values of alpha on top of an image. The time that they appear and disappear must be random too. Also the have to appear in random positions in the movie.

The stage is 504x86. Horizontally they can take this x values: 0, 22, 44, 66, 88, 110, 132, 154, 176, 198, 220, 242, 264, 286, 308, 330, 352, 374, 396, 418, 440, 462, 484. Vertically the can take this y values: 0, 22, 44, 66.

Squares Gets Stuck
just click on info or something else in the mnu and notice how the squares gets stucked. anybody know how to avoid this?

And if you get at code error message it's another problem. Dont care about that.

Popping Up Squares....
Hey all, anybody knows a tut or something where squares popup or fade in till a certain area is full? they should be right by each others side...and random, i've seen this effect very often out there, so it should be quite popular...

maybe someone has a link or hint or something

Cheers & Thx in advance

Pools Of Squares
I want to make a game with a effect similar to the Pool of Squares sample movie...

but I want when a "box" movieclip HitTest the Pool of squares then the squares will play.

I tryed using this code:

OnClipEvent(Load)
If _root.box HitTest(_.root.Square)
Telltarget (Square)
gotoAndPlay (2)

I have named all the squares the same name "Square"

Squares Gets Stuck
just click on info or something else in the mnu and notice how the squares gets stucked. anybody know how to avoid this?

And if you get at code error message it's another problem. Dont care about that.

Colour Squares
I have been asked to create a movie which looks simallar to a colour wall that you would see in a nightclub with the square changing through different colour schemes like this http://www.eyekiller.com/coloursq.gif

Has anyone see this done or know how to do this using Action Script?

Many thanks
Jamie

Need 100 Squares On Stage?
hi guys any ideas on how to:

put 100 mcs on the stage randomly 1 at a time placed and then remove 100 1 at atime randomly

big thanks to all who post

its killing me....

regards

Dissolving Squares Tutorial
Hi Chaps,

After looking at this tutorial:-

http://www.flashkit.com/movies/Effec...79/index.shtml

I am wondering whether there is a way to add an image over the top of the squares that dissolves with each square to give a scratchcard effect?

Any clues...?

cheers peeeeeple
SpaceyUK

Go To Scene After Counting All Squares
http://www.nadinagafoor.com/Portfolio.htm if you will go to this site you will see a menu button at top left, when u mouse over on it, you will see a menu comes and when you enter on Interactive option the many squares comes they When they all will disapear then next scene will start no matter which will be last i know their is counter which is counting the value of squares then after all its going for next scene, but i dont know how its possible please mail me answer or if you can arrange a small demo fla so it will really appreciable for me
i really want to learn how it possible.
Salman Lakhani
princelakhani@yahoo.com

Moving Line/Squares
Hello all.

I have a simple task. To make a blind effect with coloured lines/squares. I can't seem to get the hang of it.

Can someone point me in the direction of a tutorial? The best i can describe it, it there being a picture, and then coloured squares/lines going down it to cover it.

Thanks in advanced for your time

PixelDissolve With Fading Squares?
Hi,

I am using PixelDissolve-transition on a movieclip. But i want the squares to fade in rather than just appear.

Is there an easy way to do this without making my own class that extends the PixelDissolve class?

Thanks!

Pulsating Grid Of Squares
I'm really having problems with an effect that I think is actually quite simple to do...

In this link:
http://www.vatmanagement.dk/pages/vat.html
I've illustrated what I'm going for. The top 'frame' holds an image over which a grid of squares is suppossed to softly fadein and out at random intervals. I hope the effect is understandable.

My problem is that I just don't know whether to duplicate and place square clips over and over OR place them from the start and somehow give them a random play timer or something. My AS knowledge is somewhat primitve so that's why I come to you guys, hoping for help.

I'm not neccesarily looking for a pure copy/paste script as I'd like to know what it is I'm pasting if you know what I mean...

ANY help is greatly appreciated here. I've searched all the forums I could find, but haven't found what I'm looking for...

Calculating Pixels In Squares
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..

Any ideas how the formular looks?

Thanks in advance!







Attach Code

var square1 : array = new array(150:102,150:103, 150:104,150:105) etc...
var square2 : array = new array(150:302,150:303, 150:304,150:305)etc...
var square3 : array = new array(300:302,300:303, 300:304,300:305)etc...
etc...

























Edited: 01/27/2009 at 07:18:07 AM by Lindestrøm

Pond Of Squares Into Another Movie
HI, I followed your tutoriaql for a pond of squares and I made an animation that I then tried to integrate as a background ofmy main navigation area.

this is what I did:
1) made the pond of squares animation and tested it, worked perfectly
2) imported the pond of squares animation as a movie clip symbol, I noticed that the tweens in the symbol turned into individual keyframes which was already kinda funny
3)I just places the symbol on an individual layer in my animatin and tested it

any idea of what Im missing?

will be so greateful to get some help


flash mx newbie

Flash Squares Emergency
Oh man I've been sitting here thinking of a way to do this but I can't think straight. My mind has gone to sleep and I'm panicking. I have a tight deadline of Tuesday to this and with a lot of work still to do I can't seem to get my brain in gear.

Does anyone have an idea how to make squares fly at the screen?

If you think in a movie (a real movie) and think of the user as a camera, I wanna make the squares fly towards the user and then kind of past them (but that won't be shown)?

Is this clear what I'm trying to do?

I was hoping someone had seen a tutorial or something else that may help me. My brain is numb and I'm just making myself angrier and angrier that it won't work.

help....please

Squares Transition Effect
Trying to find a tutorial on how to create a transition effect for a slideshow where a series of squares/boxes appear to reveal an image, then transition to the next image in the same fashion. I know I've seen this many times, but can't find a tutorial for it. I guess I could create a series of square-shaped masks, but I was hoping to find something a little cooler that used actionscript to do most of the work. Any suggestions?

Thanks

Breaking Apart Bitmaps And Red Squares
sometimes to save time when im working with PNG's, i place multiple items in one png and break it apart for animation
99% of the time this works fine, but every now and then i find that a few of the tweens or mc's or whatever randomly turn into red squares - the bitmap fill has been replaced with just solid red and its unrecoverable

has anyone experienced this and figured out the cause?

Flash Squares Emergency
Oh man I've been sitting here thinking of a way to do this but I can't think straight. My mind has gone to sleep and I'm panicking. I have a tight deadline of Tuesday to this and with a lot of work still to do I can't seem to get my brain in gear.

Does anyone have an idea how to make squares fly at the screen?

If you think in a movie (a real movie) and think of the user as a camera, I wanna make the squares fly towards the user and then kind of past them (but that won't be shown)?

Is this clear what I'm trying to do?

I was hoping someone had seen a tutorial or something else that may help me. My brain is numb and I'm just making myself angrier and angrier that it won't work.

help....please

Draw Two Squares And Drag One
Draw two squares and drag one

What i am doing is trying to create a draggable window.

Below is the code to draw and drag a square. This works!

Below that is the code that I put in the Flash to draw two squares.

That also works but here are two questions:

1. The code to draw two squares seems long winded. All i did was duplicate the first part. Can this be simplified?

2. The drag causes both squares to drag which is what i want but i only want the drag to work when applied to the top square and not to the other square.
Is this possible?

Thanks!



Code:
// import the Event dispatcher class (Step1)

import mx.events.EventDispatcher

class drawMeASquare{

var thebox_mc:MovieClip;
var thecolor:Number;
var thexpos:Number;
var theypos:Number;
var thewidth:Number;
var theheight:Number;

//declare the dispatchEvent, addEventListener and removeEventListener methods that EventDispatcher uses (Step2)


function dispatchEvent() {};
function addEventListener() {};
function removeEventListener() {};


function drawMeASquare(windowthecolor:Number, windowthexpos:Number,
windowtheypos:Number,windowthewidth:Number,windowtheheight:Number){

// send instance of self to the Event Dispatcher (Step3)

mx.events.EventDispatcher.initialize(this);


this.thecolor = windowthecolor;
this.thexpos = windowthexpos;
this.theypos = windowtheypos;
this.thewidth = windowthewidth;
this.theheight = windowtheheight;

}

function drawItNow(cliptoDrawin:MovieClip){ // I draw a thebox in any movie clip

cliptoDrawin.createEmptyMovieClip("thebox_mc", cliptoDrawin.getNextHighestDepth());

this.thebox_mc = cliptoDrawin.thebox_mc;
thebox_mc.beginFill(thecolor);//(0xFF0000);
thebox_mc.moveTo(thexpos, theypos);
thebox_mc.lineTo(thewidth, theypos);
thebox_mc.lineTo(thewidth, theheight);
thebox_mc.lineTo(thexpos, theheight);
thebox_mc.lineTo(thexpos, theypos);
thebox_mc.endFill();


//event handler, called when object is pressed (mouse button down)

thebox_mc.onPress=function(){

//begin a drag operation on the movie clip (handled by Flash automatically)
this.startDrag();
//store a flag stating we're dragging
this.dragging = true;
}

//event handler, called when object is released (mouse button up)

thebox_mc.onRelease=function(){
//stop dragging
this.stopDrag();
this.dragging = false;
}

//event handler, called when object is released (button up outside object)

thebox_mc.onReleaseOutside=function(){

//stop dragging if we're currently dragging
if(this.dragging) {
this.stopDrag();
this.dragging = false;
}
}

//define the event object that is passed to any listeners when the event is broadcast (Step4)
// You must specify a target property and then name of the event or the event “type” property in the event object

var eventObject:Object = {target:this, type:'drawn'};

// any optional properties

eventObject.drawObject = 'thebox';
eventObject.whereDrawn = cliptoDrawin.thebox_mc;

//dispatch the event (Step5)
dispatchEvent(eventObject);

}

}
////////////////////////////////////////////////////////////////


Code:

// new custom class object (must be new to run the constructor)
var mySquareObject:drawMeASquare = new drawMeASquare(0x0000FF,10,10,100,200);

// new object we can use for a listener
var myListnerObj:Object = new Object;

// method definition for the drawn event
myListnerObj.drawn = function(evtObj) {


// Now trace out a few things. At this point you know the square is drawn and anything you need from the square is available!


trace("The Square is drawn: ");
trace("This is the drawObject prop: "+ evtObj.drawObject);
trace("This is the whereDrawn prop: "+ evtObj.whereDrawn);
trace("This is the event type: "+ evtObj.type);
trace("This is the event target: "+ evtObj.target);
}

// subscribe myListnerObj to mySquareObject
mySquareObject.addEventListener("drawn",myListnerObj);

// draw the square and trigger the event:
mySquareObject.drawItNow(_root);

//////////////////////////////////////////////////////////

// new custom class object (must be new to run the constructor)
var mySquareObject:drawMeASquare = new drawMeASquare(0xff00FF,10,10,300,100);

// new object we can use for a listener
var myListnerObj:Object = new Object;

// method definition for the drawn event
myListnerObj.drawn = function(evtObj) {


// Now trace out a few things. At this point you know the square is drawn and anything you need from the square is available!


trace("The Square is drawn: ");
trace("This is the drawObject prop: "+ evtObj.drawObject);
trace("This is the whereDrawn prop: "+ evtObj.whereDrawn);
trace("This is the event type: "+ evtObj.type);
trace("This is the event target: "+ evtObj.target);
}

// subscribe myListnerObj to mySquareObject
mySquareObject.addEventListener("drawn",myListnerObj);

// draw the square and trigger the event:
mySquareObject.drawItNow(_root);

Black Squares When I Publish
Hey out there.
Using flash 8 publishing to player 7

The other day i updated my player to flash 9/something. Went back to a project and noticed my bitmaps were having moving black squares apprearing on them - not all just some.
So i republished to player 8 and they went bye bye.

Is this a glitch in the new player? Has anybody else had this trouble? It was suggested by a flashman that i publish to player 7 because there are more of those players on computers, but if publishing down to 7 gets me random black squares...

any help would be a help.
thanks

Hoss

Complex Colision Detection With Two 'non Squares'
Hi, I have been researching complex collision detection.

The complex detection that I have seen involves a movie clip, whose shape is used to detect a collision with a co-ordinate, be it a mouse or a center point.

I, however would like to use two curvy shapes, and detect if they touch.

Has anyone heard of this, or am I going to have to plot all the points around my shape and do a detection loop....

M@

Passing Variables And Creating Squares
I have a movie in which when you click, a line from the left and top tween to a random spot on the screen and creates 4 squares. I want to fill two of these squares when the lines stop moving. I published the file here:
http://galatea.stetson.edu/~ssabonjo/balance Is there any way I can do this? The two lines are movie clips that randomly pick a new x or y and tween to it. I also have a version where there is a large movieclip that is a crosshair that the whole movie tweens.

I appreciate any help.

Can't Draw Anchor Points On Squares
Usually it's no problem to add anchor points to a line with the pen tool.

But why doesn't it work if the line was originally made with the rectangle tool? I can't add anchor points to jpgs, etc. dragged from the library and broken into forms, either. Any ideas?!

Notepad Text Making Little Squares
I am importing a newsletter into a flash movie from a txt file...I have no charaters imported and _sans font picked... everything is fine except wherever there is a ' a little square appears on the page...I have tried many different fonts and it either gives me the square again or ignores it completly.... any suggestions?
g

Colliding Squares - (physics Related)
Alright. so i am using two images as MC's they bounce around on the stage as if there were balls. (with gravity and walls and all that). I want to have it though so that when they collide into eachother, they act correctly when they bounce off...

anyone coded this before?

heres what i have so far:
my confusion is in the checkCollide() function



Code:
/* NOTE:

@ two squares are named mhead and phead
@ phead starts off the stage and when a button is clicked
it is added
*/
YBOUND = 501;
XBOUND = 700;
bounce = .90;
xground = .6;
xbounce = .8;
ydamp = 1;
gravity = 1;
//---------------
mhead.vy = 0;
mhead.vx = 0;
mhead.onEnterFrame = move;
mhead.onPress = drag;
mhead.onRelease = drop;
//--------------
phead._x = 60+Math.random()*(XBOUND-30);
phead._y = 200;
phead.vy = 0;
phead.vx = 0;
phead.onEnterFrame = move;
phead.onPress = drag;
phead.onRelease = drop;
setInterval(checkCollide, 30);
stop();
function checkCollide()
{
if ((!phead.drag) && (!mhead.drag))
{
if (phead.hitTest(mhead))
{
xp = phead._x;
yp = phead._y;
xm = mhead._x;
ym = mhead._y;
theta = Math.atan2(yp-ym, xp-xm);
mhead.vy *= -Math.sin(theta);
phead.vy *= Math.sin(theta);
mhead.vx *= Math.cos(theta);
phead.vx *= -Math.sin(theta);
/*??????????????????????????????????
THIS IS WHERE I AM CONFUSED!!
??????????????????????????????????*/
//mhead._x = phead._x-(xside*mhead._width/2);
}
}
}
function move()
{
if (!this.drag)
{
this.vy = (this.vy+gravity)*ydamp;
//this.vx *= xdamp;
this._x += this.vx;
this._y += this.vy;
if (this._x<this._width/2)
{
this.vx *= -1*xbounce;
this._x = this._width/2;
} else if (this._x>XBOUND-this._width/2)
{
this.vx *= -1*xbounce;
this._x = XBOUND-this._width/2;
}
if (this._y>YBOUND-this._height/2)
{
this.vx *= xground;
this.vy *= -bounce;
this._y = YBOUND-this._height/2;
} else if (this._y<this._height/2)
{
this.vy *= -bounce;
this._y = this._height/2;
}
} else
{
this.vx = this._x-this.oldX;
this.vy = this._y-this.oldY;
this.oldX = this._x;
this.oldY = this._y;
}
}
function drag()
{
this.oldX = this._x;
this.oldY = this._y;
this.startDrag(true);
this.drag = true;
}
function drop()
{
this.stopDrag();
this.drag = false;
}

Flash Game - Calculating Squares..help
Hi Everyone,

I need a little help with a simple Flash game I need to create and any thoughts would be much appreciated.

I have 10 squares which can be turned into 1 of 4 colors by clicking on them. You choose the color of the square depending on what stage you are at in the program: red if you havent started a certain chapter, green if you have completed it, etc.

After you have set all 10 squares to the appropriate color, you hit submit and depending on the number of red, green, blue and orange squares, you will be taken to the appropriate page for the stage you are at.

Now, there are (I havent actually calculated yet) alot of different possible ways the squares could be colored when you hit submit...5 red, 2 green, 2 blue, 1 orange..etc etc.

Can anyone help with how I would calculate the number of different colored squares and then how to send to the appropriate page?

Anyone do anything similar to this before?

Thx!

PS: Im using Flash 8

Rob

[F8] HitTest For Multiple Instances Of Squares?
What is the best way to create tens of squares that each can detect collisions with each other? Luckily I'm working with squares, so even I have created a hitTest that gets the desired movement in one direction (per collision).

But so far my code is only for two squares, and I'm working toward a grid of maybe 24-35 squares. Most of the squares disappear when a category is chosen, but 7-10 squares remain that grow to fit their now roomier surroundings. Each one would detect collisions with the others and react accordingly.

Searching, I've only found a reference to associative arrays, though it didn't elaborate. I will pursue it further if people think it's the way to go. What is the best format for this?

Here's my work so far within the hitTest. Mostly I'm looking to iterate this to create may of them. But please tell me if you know a better way to do hitTests or see somewhere I'm not using good practices, etc.

var difX = this._x - _root.block2._x;
var difY = this._y - _root.block2._y;

// are the squares more side-to-side than above-and-below?
if(Math.abs(difX) > Math.abs(difY)) {
if (this._x < _root.block2._x)this._x = this._x -_root.BUMPSPEED;
else this._x = this._x + _root.BUMPSPEED;
}
// if objects are more side-to-side
// if this one's left go more left
// else go right.

else{
if (this._y < _root.block2._y) this._y = this._y - _root.BUMPSPEED;
elsethis._y = this._y + _root.BUMPSPEED;
}
// otherwise go up or down

Flash Game - Calculating Squares..help
Hi Everyone,

I need a little help with a simple Flash game I need to create and any thoughts would be much appreciated.

I have 10 squares which can be turned into 1 of 4 colors by clicking on them. You choose the color of the square depending on what stage you are at in the program: red if you havent started a certain chapter, green if you have completed it, etc.

After you have set all 10 squares to the appropriate color, you hit submit and depending on the number of red, green, blue and orange squares, you will be taken to the appropriate page for the stage you are at.

Now, there are (I havent actually calculated yet) alot of different possible ways the squares could be colored when you hit submit...5 red, 2 green, 2 blue, 1 orange..etc etc.

Can anyone help with how I would calculate the number of different colored squares and then how to send to the appropriate page?

Anyone do anything similar to this before?

Thx!


Rob

Drawn Squares Change Shape?
I am using squares for a preloader movie and every time I adjust their position on the stage they change shape...the properties says they are the same size but they don't look like perfect squares anymore....i tried grouping the shape even though i made it with the rectangle tool...i don't understand this. Should i create them in photoshop instead of flash?

International Characters Rendering As Squares
Hello everyone!
Since now I extend my thanks to all those who are willing to help!

Alright!
I read this tutorial:

http://www.kirupa.com/developer/mx/i...characters.htm

I'm trying to use the easy version...
Which is a problem due to the fact that the tutorial's instructions don't seem to work on Mx 2004!

I'd like those of you that know more than I do to enlighten my unto the new code for that effect!

I'll be trying the harder version just to make sure...
Although if I don't really go anywhere with this i'll just use the "render as html" on my textbox and use html chars for the correction of this problem...

I'd just like not to have to make the litle news box with css rendered html and international characters I'm making any more complicated than it tottaly has to be!

Normal people might have to put in the info so its better if they don't have to be thaught about html and international char sets.

Group Of Squares: One Gets Bigger, Others Get Small?
Hi, im 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 i click the bottom right one, it should grow towards the far left side.

hope that explains what im looking to do?

I'm guessing the registration point needs to be changed dynamically?

thanks.

Rotating Group Of Squares Around Point
//Note: 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. I found this tutorial,
http://www.kirupa.com/developer/actionscript/trig_multiple_axis.htm
which contains the following formulas:
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;
adjustAndBuildSquare(x, y, 0);
//middle-left
x = 0;
y = squareWidth;
adjustAndBuildSquare(x, y, 1);
//middle-center
x = squareWidth;
y = squareWidth;
adjustAndBuildSquare(x, y, 2);
//middle-right
x = 2 * squareWidth;
y = squareWidth;
adjustAndBuildSquare(x, y, 3);
//bottom-center
x = squareWidth;
y = 2 * squareWidth;
adjustAndBuildSquare(x, y, 4);

void adjustAndBuildSquare(int tempX, int tempY, int instance){
int x, y;
x = originX + cos(rotation) * tempX;
y = originY + sin(rotation) * tempY;
//other stuff

}
I tried to use the formula from the Kirupa tutorial. The only part that seems iffy, though, is the radius. Since the registration/rotation point is (relatively) 0,0, I thought using tempX and tempY seemed logical, but now I'm thinking I was wrong. I know I'll need to make some adjustments because of the "top-left" orientation of the squares, but this looks way off.

This seems like a pretty simple problem, and I bet it's something dumb that I'm missing. If anyone would be willing to help me get through this, I'd be very happy. Thanks for any efforts.




no rotation (just the shapes)





and this is what happens when I implement the rotation adjustment

Creating A Matrix Of Squares With A For Loop
ok. I have a tricky question although the solution is likely staring me right in the face.

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:
runCubes = function(){
for(i=0; i<21; i++){
this.createEmptyMovieClip("cube"+i,this.getNextHighestDepth());
this["cube"+i]._alpha = 0;
this["cube"+i].attachMovie("cube","cube",this.getNextHighestDepth());
this["cube"+i]._y = 130;
this["cube"+i]._x = ((this["cube"+i]._x+45) * i);
this["cube"+i].tween("_alpha",30,1,"easeOutQuint",0.25*i);
}
for(z=0; z<11; z++){
this.createEmptyMovieClip("cube2"+z,this.getNextHighestDepth());
this["cube2"+z]._alpha = 0;
this["cube2"+z].attachMovie("cube","cube",this.getNextHighestDepth());
this["cube2"+z]._y = (130+((this["cube2"+z]._y+45) * z));
this["cube2"+z].tween("_alpha",30,1,"easeOutQuint",0.25*z);
}
}
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.

Can anyone offer any insight?

I'm kind of thinking I need to nest that in a couple more loops but I'm getting confused as to how I should do it. Thanks in advance!

Need This Effect (squares Rolling Over Graphics)
Last edited by JONICK33 : 2003-09-28 at 14:55.
























i don't know if you have talked about this effect before...(searched already 20 pages back)...

i'm looking for the effect that this page has ( http://www.hondoscenter.gr/index2.htm ) the pink squares that goes back and forth!! [and turn of your speakers...the music suxx]

...but i want it actionscripted (dynamic instances-colors-speed)!! If anyone knows where i can find such in open source... (or maybe the keywords to search it in this forum) i would be greatfull!!!

I don't have the time to do it from scratch....cause it's a bit urgent for a project...!!

flash 5 actionscript preferable!!

Thanx again!!

Complex Colision Detection With Two 'non Squares'
Hi, I have been researching complex collision detection.

The complex detection that I have seen involves a movie clip, whose shape is used to detect a collision with a co-ordinate, be it a mouse or a center point.

I, however would like to use two curvy shapes, and detect if they touch.

Has anyone heard of this, or am I going to have to plot all the points around my shape and do a detection loop....

M@

How Does The Symbols Like TM, SM, R Work On Website, Not Squares?
Can anyone explain how does the symbols work in Flash?? What I have here is symbols like TM, SM, R, etc that show up on the flash templates on the website. But on some browsers/machines, it show the symbols but on other browsers/machine, it show the square symbol. Why is that? Isn't Flash suppose to take it as built-in instead of using the symbols from the O/S??

Thanks,
FletchSOD

Copyright © 2005-08 www.BigResource.com, All rights reserved