PhotoDune

Accessing instances on second frame

29 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 1 and 100 dollars
LetsDesign says

Hi,

I can’t seem to access instances in a movie clip that aren’t on the first frame of a parent movie clip even if I tell flash to go to that frame before I attempt to reference the instance in the actionscript.

Actually this works in flash player 10 but not 9. I could just export for flash player 10 but I would rather know the answer than just avoid it and of course for better compatibility reasons.

You can see the source code and example fla Here . I’m using CS4 and programming in classes in as3 as you will be able to see from the example.

Why does this work in flash player 10 but not 9? Any help from anyone who knows how to do this properly would be greatly appreciated.

Thanks.

3005 posts
  • Community Superstar
  • Has been a member for 5-6 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Europe
+1 more
wickedpixel says

I think has something to do with enterFrame event…
you must reinitialize the event listeners for those clips/buttons on every new frame…

29 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 1 and 100 dollars
LetsDesign says

Thanks for the reply but how would I reinitialize the event listeners when programming in classes since I can’t rewrite the code on each frame?

7471 posts
  • Attended a Community Meetup
  • Community Moderator
  • Has been a member for 5-6 years
  • United Kingdom
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
  • Contributed a Blog Post
  • Beta Tester
  • Bought between 50 and 99 items
+4 more
MSFX moderator says

what are you using frames for?

the easiest work around is to have everything on the first frame and toggle it to visible = false and then toggle it back to true when you need it… :)

Ive no idea why this works in FP10 but not 9 as I havent used frames for so long now.. if you find out please post as it would be useful to know like you said :)

3005 posts
  • Community Superstar
  • Has been a member for 5-6 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Europe
+1 more
wickedpixel says
Thanks for the reply but how would I reinitialize the event listeners when programming in classes since I can’t rewrite the code on each frame?

addEventListener(Event.ENTER_FRAME, reinitialiseListeners);

make yourself a function that generates those eventlisteners..
but using scripted clips on frames it’s a bad approach anyway…

by
by
by
by
by