Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move to next scene actionscript code

Status
Not open for further replies.

slickyboi

Programmer
Oct 16, 2003
29
0
0
US
Hi all,

I am working on a Matrix Parody film and I have this actionscript to create a matrix code raining effect but I want it to go to the next frame after frame 200 but I am not a guru with flash action scripting and wondering if anyone would know what I need to add to this script to make this scene move to the next scene after frame 200.

Thank you! :)

function dropStart() {
if (Math.random()>0.9) {
this._visible = true;
this.onEnterFrame = drop;
}
}
function drop() {
// create a trail character at the current position...
trailName = "trail"+trail;
trail++;
attachMovie("katakana", trailName, trail);
_root[trailName]._x = this._x;
_root[trailName]._y = this._y;
_root[trailName].kata_txt.text = this.kata_txt.text;
_root[trailName].fader_color = new Color(_root[trailName]);
_root[trailName].fader_color.setRGB(0x008000);
_root[trailName].onEnterFrame = fadeTrail;
//
//Move the head character of the trail down by one character...
this.kata_txt.text = String.fromCharCode(Math.floor(Math.random()*26)+97);
this._y += 10;
// If the head character has reached the bottom, restart it at the top...
if (this._y>400) {
this._x = Math.round(Math.random()*700);
this._y = 0;
}
}
function fadeTrail() {
if (Math.random()>0.95) {
this.removeMovieClip();
}
if (trail>1000) {
trail = 100;
}
}
/*

MAIN PROGRAM INITIALIZATION

*/
trail = 100;
for (i=0; i<20; i++) {
newName = &quot;char&quot;+i;
attachMovie(&quot;katakana&quot;, newName, i);
_root[newName]._x = Math.round(Math.random()*550);
_root[newName]._visible = false;
_root[newName].onEnterFrame = dropStart;

}

 
This is a 200 frames scene?

Regards,

cubalibre2.gif
 
No its an actionscript written in the 1st frame and it just loops. I tried to add a blank keyframe with a new layer at frame 200 with a gotoAndPlay(&quot;Credits&quot;); but it just seems to ignore it and just keeps looping... Its like the actionscript is just looping in the frame 1 from the actionscript.
 
Confusion! Do you in fact have a second scene? If this first scene is 200 frames long and you don't have either a gotoAndPlay(1); action or a stop action somewhere after the first frame, then those 200 frames should play, and then your movie continue on to scene 2.

Can you post a link to your .fla?

Regards,

cubalibre2.gif
 
Hmmmm I don't have it posted anywhere. But I can send you the fla in an email its about 25kb I just added a 2nd scene in there to give you a better idea?
 
Yes I have a second scene. In the First scene there is only 1 blank keyframe and in that keyframe there is the actionscript I posted above. In the First Scene I wanted it to play for only 12 sec then go into the credits scene (scene2) and I thought if I added frames all the way till I reached frame 200 then it would just go into scene2 But it just keeps looping in the First Scene. I think I might of missed something in the actionscript like maybe adding a _root gotoAndplay(&quot;credits&quot;) function after a certain number of loops.
 
Hit my handle for my e-mail... Use the second one!

Better zip it up anyway and in MX format only, not MX2004.

Regards,

cubalibre2.gif
 
Ok I sent it off to ya! I also added the font in there just in case you didnt have it.. thanks a million for taking a look at this for me old newbie :)
 
What's the whole idea behind all of this? To have credits over the matrix display after a while?

Regards,

cubalibre2.gif
 
I wanted the matrix display to stop and go onto the next scene where the credits would roll up..
 
So where did you pick up this 200 frames bit?
How long do you want the effect to last before it goes to the next scene, and would it just cut to the next scene, or fade out or end in some other manner?

Regards,

cubalibre2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top