I think im doing something very wrong

here is the flash file www.wavebomb.com/tiler.zip

I am trying to create a movie that tiles the screen with tiles, problem is if i feed the global variables ive set up with different kinds of data, my conditionals dont quite make it happen how i would like them too. At the moment ive set up the variable values so they do work, bear with me.....

here is a run through of what ive done, ive created a movieClip called tile and placed offscreen on the main stage. the first frame determines how many tiles it will take to tile the screen (works best if the screen area to tile size are dividable)

[main stage - frame:1]
Code:
// variables
 box          = 100;
 areawidth    = 700;
 areaheight   = 400;
 totalwidth   = areawidth/box;
 totalheight  = areaheight/box;
 totalarea    = totalwidth*totalheight;
 offsetcenter = box/2;
 copy_number  = 0;
 x_pos        = 0;
 y_pos        = 0;
 count	      = 1;

// set up tile size

tile._height = box;
tile._width = box;
this code sets up my tile to area stuff, now frame 2 does all the work by duplicating the tiles to fit the screen.

I will skip all the rest of the stuff on the main stage as its irrelevant (i hope) to what im trying to achieve.

ok, in the movieClip named Symbol1 on frame 2:

[movieClip: Symbol1 - frame 2]
Code:
xcurrent = dabox._x;
ycurrent = dabox._y;
xOffset = 100; // this can be changed
yOffset = -20;
size = 1; // this can be changed
sizerate=10; // this can be changed
transitionSpeed = 20; // this can be changed
alphaSpeed = 30; // this can be changed
alpha = 0; // this can be changed
rotation = 180; // this can be changed
rotationspeed = 40; // this can be changed
dabox._x = xcurrent + xOffset;
dabox._y = ycurrent + yOffset;
dabox._alpha = alpha;
dabox._xscale = size;
dabox._yscale = size;
dabox._rotation = rotation;
Ok this sets up the offsets for the clip to its original location and rotation, alpha , etc. try changing the key values commented change this and see what happens, not what i expect to happen from the code in frame 3:

Now, frame 3 has a load of conditional statements as follows:

[movieClip: Symbol2 - frame 3]

Code:
// relocate the box

if (xOffset > 0){
dabox._x = xOffset - transitionSpeed;
xOffset -= transitionSpeed;
}
if (xOffset < 0){
dabox._x = xOffset + transitionSpeed;
xOffset += transitionSpeed;
}
if (yOffset > 0){
dabox._y = yOffset - transitionSpeed;
yOffset -= transitionSpeed;
}
if (yOffset < 0){
dabox._y = yOffset + transitionSpeed;
yOffset += transitionSpeed;
}

// resize the box
if (size < 100){
dabox._xscale= size;
dabox._yscale= size;
size +=sizerate;
}

if (size > 100){
dabox._xscale= 100;
dabox._yscale= 100;
}

// rotate back to normal
if (rotation > 0){
dabox._rotation = rotation;
rotation -=rotationspeed;
}
if (rotation < 0){
dabox._rotation = 0;

}


// increase alpha to max

if (alpha < 100){
dabox._alpha = alpha;
alpha += alphaSpeed;
}
if (alpha > 100){
dabox._alpha = 100;
}
if (xOffset == 0 && yOffset == 0 && dabox._xscale >= 100  && dabox._yscale >= 100 && dabox._alpha >=100 && dabox._rotation == 0){
stop();
}
frame 4 is the usual go back gotoAndPlay(_currentframe-1);

Ok well, it doesnt work when i change the values in frame 2, I get wierd results, when changing the anglespeed value, it seems to get stuck at a certain degree, also if the alphaspeed is too low, it never quite fades into maximium,
some combinations of values work, some dont, i thought all combinations would work, I dont know why as my final conditional in frame 3 tells the movie to stop if everything is back to the way it was before the script in frame 2 started working any1 see any obvious mistakes if not everyting ive done?

thanks

ezcodah



[Edited by ezcodah on 07-21-2001 at 06:53 AM]