Skip to main content
Participating Frequently
July 2, 2008
Question

Loading Swfs From Array For Slideshow/gallery - Help Needed

  • July 2, 2008
  • 13 replies
  • 650 views
I'm a kind of an AS noob and would appreciate any help - did a lot of trial and error to fix to no avail (please forgive SO much commented out stuff in my file). Any help greatly appreciated - if you need anything else to give me any info, let me know. THANKS!!!!

It seems to not want to load anything other than the swf in index 1 of the array.

i have 3 swfs (for a calender image movie, will have more once i can get working) that load in on their intro and stop (later I will at a timer to time a sequenced progression). Upon clicking the button it is supposed to go to an play the currently loaded movies 'outro' frame label and pass the 'currentIndex' variable to the main timeline on the last frame of the currently loaded swf which then loads the clicked swf. I was doing it this way to call the swf by a number so i could run a timed sequential move of them where a frame on the timeline calls the next in the sequence.

This topic has been closed for replies.

13 replies

kglad
Community Expert
Community Expert
July 8, 2008
you're welcome.

(and hey, i live in orange county, ca!!!)
Participating Frequently
July 8, 2008
it worked!!!!!! I had it setting the currentIndex to 1 on that frame. Made sure I initialized the currentindex at the beginning in my main movie (or it played 1 twice, setting the array index to 0 on the second one). THANK YOU!!! IF YOU LIVE IN SOCAL, I OWE YOU A DRINK.

Now I am off to try to work in pause and play buttons.
kglad
Community Expert
Community Expert
July 8, 2008
no emails unless you want to hire me to fix your problem.

what's pic3 timer? and does your onEnterFrame loop do anything to currentIndex?
kglad
Community Expert
Community Expert
July 8, 2008
does

var currentIndex:Number = 0;

execute more than once (because that frame plays more than once)?
Participating Frequently
July 8, 2008
not that I know of. I was just using that to initialize the variable - all other instances changes the currentIndex var. Do you want me to email you my .fla file to see what I am doing wrong?
kglad
Community Expert
Community Expert
July 8, 2008
use:

_level0.currentIndex everywhere.
Participating Frequently
July 8, 2008
did that. the 3rd movie just stayed there like it has been. Then I changed the load movie path from _parent to _level0 and it at least then unloaded (went through the 'outro') and then loaded it from the intro: almost like it is doing what it is supposed to be not changing the currentIndex to 0. got this on the trace:

_level0.button3
_level0.calenderTarget.instance22
_level0.calenderTarget.instance27
_level0.calenderTarget.instance36
kglad
Community Expert
Community Expert
July 8, 2008
is _level0.calenderTarget the output of the trace(this) statement that's located on the same timeline as currentIndex?

if yes, you can use:

_level0.calenderTarget.currentIndex

whenever you need to increment, reset or use currentIndex.
Participating Frequently
July 8, 2008
i think so, so i replaced that in my pic 3 swf and got this: (the 'instance15' are when it hits the timer position - but nothing changes in my movie). I am going to include the code for my main movie and pic3 movie.

_level0
_level0.button3
_level0.calenderTarget.instance15
_level0.calenderTarget.instance15
_level0.calenderTarget.instance15

Participating Frequently
July 8, 2008
okay, did it (i can post my code if needed). Also, I have't thanked you enough because I can't - my god, thank you thank you thank you.


autoloaded pic1: _level0

onrelease of button1: _level0.button1
onrelease of button2: _level0.button2
_level0.calenderTarget


on timer event of pic2: _level0.calenderTarget.instance46



timer event of pic3 (the one that i am trying to get to go back tot the first pic and start over) has created all of these at different times:

_level0.calenderTarget.instance22
_level0.calenderTarget.instance22


_level0.calenderTarget.instance58
_level0.calenderTarget.instance58

_level0.calenderTarget.instance15
_level0.calenderTarget.instance15
_level0.calenderTarget.instance15
_level0.calenderTarget.instance15
kglad
Community Expert
Community Expert
July 8, 2008
if you want to find the relative path to any timeline from any timeline, you can use trace(this) on both timelines.

so, place trace(this) on the timeline where currentIndex is defined and on the timeline where you want to update it and where you need to use it to load the next array member.

post your results if you're not sure how to use that info.
Participating Frequently
July 8, 2008
i guess i didn't realize the difference between _root and _parent. should have been using _parent (per the Flash help) but I changed the _root to _parent and now instead of it reloading the last clip over and over it just does nothing. I am retarded. Don't know what the hell I am doing wrong. My logic seems right.
kglad
Community Expert
Community Expert
July 8, 2008
is _root.currentIndex the same as _parent.currentIndex? (use the trace() function to check.)