I’ve been trying over and over again and i am not capable of makin code to work!! Damm, i’m even more numb for this than i thought. I want a movie clip to grow to a certain point and when it reaches it decrease till certain point, and grow again etc. But it has to answer to the movement of the mouse. And i can’t even make it grow and decrease. Please someone give me a hint… i’d love to develope something myself… not just copy-pasteThis shouldn’t be so complicated, right??. Is a challenge for me I HAVE TO BE CAPABLE!! (maybe i’m not )
I have come to this, but is not working at all…
onClipEvent (enterFrame){
var x = _xscale
var y = _yscale
if (x>=100) this._xscale = (x-1);
if (y>=100) this._yscale = (y-1);
if (x<= 10) this._xscale = (x+1);
if (y<= 10)this._yscale = (y+1);
}
well…check your if statements. Your syntax is incorrect. Since you dont’ want to copy and paste…
a few pointers…
take one thing at a time. It is a mistake to try to tackle all the code as once; especially if you’re just starting out.
use trace whenever possible. Trace is your friend.
Think about what you’re coding. (sound dumb? It’s not…) For example, when to use onClipEvent(load), instead of …(enterframe). The difference will make or break your code.
Post back when you’re ready…we’ll try to nudge you there.
Hey, what’s wrong with the ifs? They look good to me.
A few things I find strange:
sometimes you use this._xscale, sometimes you don’t.
the load isn’t correct. The normal scale for an object is 100, so doind i=i+1 (i=1 would do the same) and then _xscale=i makes the clip very very small
the enterFrame looks good, but you shouldn’t use the variables x and y, work directly with _xscale and _yscale.
Ok, I’ll deal with this today and hopefully tonight I will have something to say… I’ll be happy of having found the correct code or I will be with my head in the bath tube flushing again and again
!!
Thanks!!
I have half head in the tube bath… haven’t flushed yet
Well, finally i manager to make it grow till 200, but it wouldn’t decrease… and i have no idea why, because i used the if’s whit trace and they do the tracin correctly, but when i change it to signs… doesn’t work… any new clues?? sure i’m obsesed with a stupid thing that is just in front of my face… :-\
Here is what i have:
onClipEvent (enterFrame){
var ancho = this._xscale
var alto = this._yscale
if (ancho>=200) this._xscale = ancho–;
if (ancho>= 10) this._xscale = alto++;
if (alto>=200) this._yscale = alto–;
if (alto>= 10)this._yscale = alto++;
}
Thanks in advance…
I’ve been looking harder after I posted this for the first time…
I guess I have a problem with the >= and <=, because they dont allow each other to work. Am I right?? But still havent found solution.
:-\
Maybe it was an interesting question, too bad i couldn’t be bothered to check it out coz the title “says it all”…refering to that post in random…the guys so right!!
Yes, you are right! But I thought i had to be capable to make it grow and decrease before messing with the mouse.
Now i’m sure why is not decreasing or viceversa. If i say grow if <=20 it does it but then i say decrease if >=80 or if <=80. In both cases this can’t happen because of the first if. Am I right on that point?? (god, explaining this in english can de harder than i thought! did i made myself understood?? :-\ )…
I’m still struggling to find a way. I’m a bit stubborn and also must admit I was veeeeery bad at maths in school. So I guess my brains are no fit to that! he, he… I have to get them in good shape =)
onClipEvent (enterFrame){
var ancho = this._xscale
var alto = this._yscale
if (ancho>=200) this._xscale = ancho--;
if (ancho>= 10) this._xscale = alto++;
if (alto>=200) this._yscale = alto--;
if (alto>= 10)this._yscale = alto++;
}
There is a problem with your if tests, but not the one you mentionned. Let’s debug:
Let’s say ancho=100.
The first if returns false, nothing happens.
The second if returns true, the thing grows.
Now if ancho=300:
The first if returns true, the thing shrinks.
The second if returns true, the thing grows.
Result: Nothing happened.
Hi!
Well, ilyaslamasse, i see what you mean by that… is more or less the thing i suspected when i said i had a problem with >= and <=… But i still cannot find a solution… He, he… this is begining to look like a game… “Follow the clues”, ha, ha…
Oh, and about having a .fla… well, i’m triying with a simple saquare, so i gues there is no need of a .fla, is just a plain movieclip…
Well, anyway, i wonder if I should use functions??? If so, I definately give up, because functions are too much for me for the moment.
I fell pretty silly, but at least I’ll keep on trying.
Hi!, i’m only writting a few words just to let you know i’m still here!
I have had no time to work on this in the last four days due to the job ( the real boring one you get paid for:-\ ) But i’m still thinking on this, ok? tomorrow you’ll heve some news from me again… thanks for the patience again =)
Sure i’ll explain… the simple theory is that something grows to a certain point and then decreases to a certain point, etc… kinda loop, i guess.
Umm, now i’m thinking maybe i should hace tried a [COLOR=darkblue]while[/COLOR] action…
Don’t know.
Anyway, once i know how to do that i’ll try to find out a way to make it answer to the mouse movement. But now i fell really uncapable of making the thing grow and shrink myself :-\