3 Replies - 891 Views - Last Post: 11 February 2009 - 07:12 AM

#1 bunnyguts  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 10-February 09

Need help loading a page after a movie clip has played

Post icon  Posted 10 February 2009 - 11:04 PM

I need some help with this code - I feel like a total muppet trying to figure it out.

I have a splash page with 2 buttons: French (button_french) & English (button_english). When either of these buttons are clicked, a movie clip (mc_redshape) plays. All of this I got to work fine, but the problem: I want the page to load the french or english site after the movie clip plays, obviously depending on which button was clicked.

I've tried it with an event dispatch & listener, but I'm not sure if I am doing it right as even a trace() is not working.

The code is as follows:

On the French button
on (press) {
	_root.mc_redshape.play();
	this.mc_redshape.addEventListener("done", linkaction);

function linkaction(){
trace('this works')
}



On the last frame of the movie clip
stop();
dispatchEvent(new Event("done", true, true));



I've look in the boards, and haven't really found anything that helps, so I apologize if this question has already been addressed. Even a direction to look in would be greatly appreciated!

Is This A Good Question/Topic? 0
  • +

Replies To: Need help loading a page after a movie clip has played

#2 skater_00  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 12
  • View blog
  • Posts: 256
  • Joined: 30-April 08

Re: Need help loading a page after a movie clip has played

Posted 10 February 2009 - 11:22 PM

Fix your syntax errors, and see if it still refuses to launch your function.

on (press) {
    _root.mc_redshape.play();
    this.mc_redshape.addEventListener("done", linkaction);
}     // Add "}"

function linkaction() {
    trace('this works');     // Add ";"
}

Was This Post Helpful? 0
  • +
  • -

#3 bunnyguts  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 10-February 09

Re: Need help loading a page after a movie clip has played

Posted 11 February 2009 - 12:30 AM

Fixed my syntax issues, but it's still not running the function.

Also using the syntax that was posted, I was getting this error Statement must appear within on handler, so I changed the syntax so that the function is with in the curly braces of the on statement (which fixed the issue).

Not sure if the fact that I am using ActionScript2.0 has anything to do with it? Also my movie clip is in a separate layer from the buttons.
Was This Post Helpful? 0
  • +
  • -

#4 skater_00  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 12
  • View blog
  • Posts: 256
  • Joined: 30-April 08

Re: Need help loading a page after a movie clip has played

Posted 11 February 2009 - 07:12 AM

View Postbunnyguts, on 11 Feb, 2009 - 08:30 AM, said:

Also using the syntax that was posted, I was getting this error Statement must appear within on handler, so I changed the syntax so that the function is with in the curly braces of the on statement (which fixed the issue).


Forget what I said! Actually, I'm not familiar with AS2. I may need to do some research later today.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1