I give up! Some clues?

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!! :wink: (maybe i’m not :frowning: )
I have come to this, but is not working at all…

onClipEvent (load){
i= i+1;
this._xscale = i;
this._yscale = i;
}

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.

pom :asian:

yes… actually they are correct… I am a dunce and somehow was looking at the wrong thing! Sorry… the rest stands true, however.

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
:wink: !!
Thanks!!

I have half head in the tube bath… haven’t flushed yet :stuck_out_tongue:

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.
:-\ :frowning:

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!!

I think I missed something because I dont see anything about the movement of the mouse. Wasn’t that part of what you were trying to do?

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 :wink: 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 =)

Thanks a lot for your patience!!

*Originally posted by fadingblack *

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.

Now you have to find how to fix that…

pom :asian:

Are you still working on this? If so, do you have a fla you can post?

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. :wink:

Nope, you can avoid functions. I think the best thing to do in that case is to take a piece of paper and check everything, a bit like I did.

And next clue: you might want to use a variable that will tell you if you’re growing or shrinking…

pom :stuck_out_tongue:

Hi!, i’m only writting a few words just to let you know i’m still here! :slight_smile:
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 =)

http://www.dcs.napier.ac.uk/~bill/design_tips51.htm

I am interested in this too. We will figure this out:)

Ummm, after the post of toadclipper i’m even more puzzled tha before… still working on it. Let’s see if i can have a conclusion.

And I wonder Is this variable correct-possible-useful???

var = this._xscale++

:-\

So, that’s it! I really give up. ilyaslamasse, I guess i’ll have to stick to the copy-paste style :frowning:

I can only get the thing growing in one direction. I’m not made for coding (DAMM!)…

I’m in your hands peolple… any ideas, clues, solutions… my head is going to explode if i think about that one more time!..

Do you want someone to do it for you? If so, can you explain EXACTLY what you want? (I’m getting old, sorry…)

pom :asian:

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 :-\

jeah, this is really interesting!!

If you find it I would like to know it too!

DidiusTheGreat