Variation on the Random Quote Tutorial - Stuck!

I followed the Random Quote Tutorial, pretty self explanatory really as all the tutorials are…(thank goodness!!)

My idea, please tell me if this isn’t possible before I lose more hair!!, is simple to have a whole bunch of words, load them randomly into a text box and then animate that text box randomly on the stage.

So for example I’d have ‘BLAH’ loaded into a random area on the stage (or a specific set of coords if needs be) and then ‘BLAH’ would scale up from zero to fade out into _alpha=0 and a massive scale.

The problem I’m having is that whilst I can follow the random quote tutorial that relies on pressing a button to trigger the quote being loaded, thats my first problem.

How to load the random word into this text box to then be displayed on the screen, do something with that text box (the animation) then loop back round once its finished.

I’m assuming I get this by…if textbox._alpha = 0 then go back to the beginning type thing?!

And I’m also assuming I can animate the dynamic text box within a movie clip using script.

So textbox._x++1 or something similar…haven’t even touched on the easing part yet head hurts now!!!

Hope I’ve explained myself well enough and I’m sure I’m one step away from going ‘OH YEAH!’

Thanks in advance :slight_smile:

Ok…bit of an update.

I’ve figured out how to load a random word into a text box that sits in a movieclip on the stage.

Using arrays. Whole new world that was!

So now my original problem remains.

How do I go about placing this movie clip (with random word in it) somewhere on the stage at width = 0 height = 0 and then animating it up to eventually fade out nicely at massive size alpha=0

is it something to do with onEnterframe?

And once its faded out I need it to pause for 2/3 secs before it loads in the next quote out the array, so need to clear the original movie clip and load in a new one…hmm thats more complex I think…


obj._yscale=obj._xscale=0;
obj.onEnterFrame = function(){
this._yscale=this._xscale++;
this._alpha = -(this._xscale-100);
this._alpha<=5 ? this.removeMovieClip() : null;
}

Trying to understand this.

obj is the instance of the movie clip??

So first line you’re setting the scale at zero.
Then scaling it up and fading out at the same time in the next 2 lines.

Its the last line I’m unclear on whats that do?

And do I add this onto my script layer or onto the movieclip layer itself??

Thanks v much food for thought :wink:

yes obj is the instance name


obj._yscale=obj._xscale=0;
//set scale to 0
obj.onEnterFrame = function(){
//set enterFrame event
this._yscale=this._xscale++;
//scale up
this._alpha = -(this._xscale-100);
//set alpha to negative scale - 100
//thus, scale is 50; for example
//alpha = -50-100 = 50
this._alpha<=5 ? this.removeMovieClip() : null;
//if the alpha is <= 5 remove it, else, nothing.
}

hope that clears it up

Yep I understand that. That last line is interesting I didn’t know you could use that sort of syntax for an if/else statement. Never seen that before.

I do however have a bit of a problem as its scaling up…weird now. Messed with the numbers too but it goes real strange.

[URL=“http://www.nakedwizard.com/ktxt.fla”]http://www.nakedwizard.com/ktxt.fla (flash 8)

Basically just trying to acheive what the tweened bit behind does.

Thanks very much learned about 40 times more than I expected!! :slight_smile: