Skip to main content
jasperc74665832
Participant
June 8, 2018
Answered

Need help! School project

  • June 8, 2018
  • 1 reply
  • 174 views

So, I'm currently working on a project for school, and I ran into this annoying problem that I can't seem to get my buttons work.

This is the code that I have in the movieclip:

import flash.events.MouseEvent;

btnPattaya.addEventListener(MouseEvent.CLICK, resort1);

function resort1(e:MouseEvent){

MovieClip(parent.parent).gotoAndPlay("label1");

}

btnKhaoyai.addEventListener(MouseEvent.CLICK, resort2);

function resort2(e:MouseEvent){

MovieClip(parent.parent).gotoAndPlay("label2");

}

On my main timeline I have placed 3 labels to play an animation.

btnMiaMuiNe.addEventListener(MouseEvent.CLICK, resort3);

function resort3(e:MouseEvent){

MovieClip(parent.parent).gotoAndPlay("label3");

}

The code on the main timeline to make a scrollpane is this:

scrollPane.source = myContent; !-- The myContent is the class name of my Movieclip.

scrollPane.setSize(1220, 683);

I'm relative new to actionscript and I hope you guys could help me.

    This topic has been closed for replies.
    Correct answer JoãoCésar17023019

    Hi.

    Instead of:

    MovieClip(parent.parent)

    Use:

    MovieClip(parent.parent.parent)

    Because using parent 2x will target the ScrollPane itself. But, if you use parent 3x, then you will effectively target the main timeline.

    I hope this helps.

    Regards,

    JC

    1 reply

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    June 8, 2018

    Hi.

    Instead of:

    MovieClip(parent.parent)

    Use:

    MovieClip(parent.parent.parent)

    Because using parent 2x will target the ScrollPane itself. But, if you use parent 3x, then you will effectively target the main timeline.

    I hope this helps.

    Regards,

    JC