PDA

View Full Version : strangest thing...



haam
April 21st, 2007, 04:49 PM
hi-

i'm building a game with 32 thumbnails as the main user interface. i'm using lee's sliding panel combined with my own button rollOver&Out functions.

everything is working properly however there is the strangest anomaly that I just can't figure out.

i've built it so my thumbnails are MCs. when you rollOver a MC it calls a function to increase the x and y scale to 150%. when you rollOut it calls another function to decrease the x and y scale back to 100%

all working fine.

however, if you roll over and back off of a thumbnail quickly -- after they resize back to 100% the y scale pops back up to 150% - for (to me) no apparent reason. there's no script that would be telling it to do so.

even weirder if you rollover and back out slowly it doesn't do it. only if you do it too fast.

i'm loosing my mind and i can't figure out why it's doing it.

please please take a look and see if you can tell me why it's happening!

i love you long time!

swf:
http://multimediahaam.com/archive/bedroom/bedroomMakeoverGame.swf

fla:
http://multimediahaam.com/archive/bedroom/bedroomMakeoverGame.fla

*the art and vector images are copy written. do not be a jerk-off and steal anything please.*

glosrfc
April 21st, 2007, 06:27 PM
Just having a quick look now...and there are only a couple of anomalies I can see:

thumb9
thumb31
thumb10

These all have a movieclip inside but none of them have been given instance names, e.g. itemxxdrag_mc

The same thing with thumb25 although it took me a few minutes to figure this out because both layers were locked.

Finally, the "symbol" on thumb18 isn't actually a movieclip at all but a group of shapes instead of the item18 symbol from your library.

So maybe it's this combination of missing instance names plus thumb18 not actually being a symbol that's making your AS act a bit funny?

Edit:
Hmmm...I tried changing them and still getting the same thing. It's also got nothing to do with the missing semicolon at the end of line 7 either.

haam
April 21st, 2007, 07:14 PM
Thanks for looking.

I really don't see any reason why MCs with missing instance names would have anything to do with the thumbnails resizing themselves.

Did you see that it's only happening when rolled out quickly but not slowly? I can't figure out what instance names would have to do with that.

So to appease your suggestions I went in to each thumbnail and broke them down so they are 1 frame, with a background that is a MC with an instance name and a group of vectors on top.

No extra MCs, no missing instance names.

It's still doing it. It's really starting to peev me off man, there's NO REASON! hhaha.

I re-uploaded the fla and swf with the changes you suggested. Take a look if you could to see if there might be any other reasons.

I know flash is buggy sometimes but this is just ridiculous!

thanks again for looking...

haam
April 21st, 2007, 07:18 PM
oops, didn't see your edit.

that's what i'm getting too. there is just nothing there that explains it!!!

edit:
if there is no explanation for it can anyone suggest a work around? i've tried setting the size of the thumbnail with an onMotionFinished function but that didn't work either.

glosrfc
April 21st, 2007, 07:23 PM
Hehe...I just made all the same changes as you...and if I were you, I'd be peeved off too!

It's like it's forgetting to reset the _yscale values but only on some of the MC's and not others. Which makes me think of just one thing really (although it is kinda screwy)...maybe the tween is making some of the item MC's slightly bigger than the background MC's? Why it would do this I don't know but that's what seems to be happening. It's almost as if it's leaving an invisible footprint of the scaled-up MC behind so that, when you mouse over it slowly, it repeats the ySize2.

As you said in your thread title...it is the strangest thing!

haam
April 21st, 2007, 07:27 PM
yea. the speed of the roll over part of it is absolutely killing me.

if it were what you were suggesting (which is fair enough) then why would it bother firing the thumbSmall function? AND then resize only the _yscale?

and why not the _xscale?

and it doesn't matter if it's _width and _height or _xscale and _yscale... it does the exact same thing with either property.

and the roll over speed...

oh man, i could throw my monitor thru a wall right now. :m:

any other thoughts guys?

glosrfc
April 21st, 2007, 07:31 PM
I did have another thought too. The fact that it's connected with the speed with which you mouseover - it might be something to do with the framerate and the .8 sec delay so that the tween finishes too quickly (or too slowly) so that your still triggering the mouseover?

Aha! I changed the two references in the Tween class from .8 to 1 and now it seems to work okay!

Edit:
Well, it's behaving now so I reckon that was it...for some reason the mouseover was still triggering and firing off the thumbBig function. But by the time this was fired the thumbSmall function was being triggered as well. I guess that's why it was sizing the _xscale in accordance with the one function but the _yscale according to the other function? Possibly because the .8 was tied to the _xscale in thumbBig but to the _yscale in thumbSmall perhaps.
Either way, if it wasn't confusing Flash, it was certainly confusing me :D

haam
April 21st, 2007, 07:38 PM
AH!

AHHHHHHHHHH!

I spent 2 hours with this today!

I could kiss you man!

Thanks again for looking. I like using different numerical values for those so that it gives it a more uneven, lava-like bounce... i would have NEVER thought to change those values.

I'm gonna buy you a pizza :love:

Edit:
It looks like anytime there's a decimal added to the tween time it makes it act that way. if you make it 1.8 instead it does the same thing, but this time to the _xscale! CRAZY! Thanks again.

glosrfc
April 21st, 2007, 07:39 PM
Just as an experiment, I put the .8's back in but tied them both to the _yscale:

var xSize = new Tween(this, "_xscale", Elastic.easeOut, this._xscale, 150, 1, true);
var ySize = new Tween(this, "_yscale", Elastic.easeOut, this._yscale, 150, .8, true);
}

function thumbSmall (){
trace("out")
var xSize2 = new Tween(this, "_xscale", Elastic.easeOut, this._xscale, 100, 1, true);
var ySize2 = new Tween(this, "_yscale", Elastic.easeOut, this._yscale, 100, .8, true);
and that seems to be behaving too. So I reckon we've narrowed down the cause of the problem...explaining it is something else!

glosrfc
April 21st, 2007, 07:41 PM
AH!

AHHHHHHHHHH!

I spent 2 hours with this today!

I could kiss you man!

Thanks again for looking. I like using different numerical values for those so that it gives it a more lava-like bounce... i would have NEVER thought to change those values.

I'm gonna buy you a pizza :love:

Hahaha...no problem. Sometimes a fresh pair of eyes helps - even if I am usually stumbling around in the dark when it comes to AS2 and classes!

Oh, and I like extra anchovies ;)

glosrfc
April 21st, 2007, 07:45 PM
And there's more good news too...when you work on the next bit of the game (dragging the items into the room) you won't have to go hunting for all those missing instance names now :D

Edit:
Just seen your edit...I think decimals are fine BUT when you're scaling up AND down it looks like you have to apply the same time delays to the same properties.

haam
April 21st, 2007, 07:58 PM
@glosrfc: right right, playing with all that now. so weird.

when you click on a thumbnail it actually goes invisible and the real-sized item becomes visible, aligned center with the mouse. those real-size items are in a different MC and actually have their instance names intact. so the missing names inside the thumbnails were always moot (which is why they were sporadic)...

none the less. i thank you mucho.

@stringy : thanks! i'm definitely going to employ that for loop to make my button commands more streamlined. thanks for that.