Skip to main content
October 30, 2011
Question

Using ScrollPane

  • October 30, 2011
  • 1 reply
  • 638 views

Hi

Please have a look at the following code:

LeftArrow.onRelease = function()

{   

    emptyMC.loadMovie("images/img1" + 1 + ".jpg");

    ScrollPane.contentPath = "empty_MC"; //this works with those movieclips which have images but does not work if images loaded this way

};

RightArrow.onRelease = function()

{

    emptyMC.loadMovie("images/img2" + 2 + ".jpg");

    ScrollPane.contentPath = "empty_MC";   

};

I have 4 to 5 images and want to load into emptyMC, this emptyMC movieclip is in library,

ScrollPane works with those movieclips which have images in them but not works with above code while calling is same I mean to through identifier name. emptyMC has identifier name empty_MC.

what is wrong with this code please help to solve this.

Regards,

Shahzad

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
October 30, 2011

assign your scrollpane an instance name (eg, sp) and use:

LeftArrow.onRelease = function()

{   

var mc:MovieClip=sp.depthChild0.createEmptyMovieClip("mc",1);

    mc.loadMovie("images/img1" + 1 + ".jpg");

};

October 30, 2011

it creates mc outside ScrollPane...

ScrollPane.contentPath = "empty_MC";

in above code the movieclip consists of an image and when its identifiername "empty_MC" is given to ScrollPane.contentPath it works and displays image inside ScrollPane

I want same behaviour but want to load images in movieclip on each click is this possible that movieclip remain in library and data inside that could be changed.

kglad
Community Expert
Community Expert
October 30, 2011

you didn't follow my suggestions.  use exactly the code i suggested changing only your scrollpane name, if necessary.