Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 317
  • Last Modified:

Flash timeline jumps unexpectedly CS5 AS3

Hello all,

I've been developing a flash website, which has been going just fine.  I'm fairly new to AS3, and realize I haven't been removing any listeners on any of my buttons.  I'm sure there could be a few other bad coding practices that I'm not aware of that could possibly be causing my problem.

Problem:

I have a intro video on the 1st frame of my timeline which is being called from a server using the file/import video.  When the video finished I have a eventlistener that jumps the timeline to frame 2, and the animation/website begins.  There are also 3 other videos throughout the website, fyi.  

Now what seems to happen is the timeline will, for no reason at all, hop to the 2nd frame and play.  So someone could be looking at section 5 (frame 273, for example) of the website, then suddenly, they are back at the intro part (frame 2) of the website (just after the video I mentioned above).

I keep mentioning the videos because this didn't seem to happen before I imported the videos.  From what I can tell, the user doesn't even have to be clicking, or hovering over anything for this to occur.  It seems entirely random.

I suppose I could proved a link to view the site, but would rather not, as the site isn't public yet.

Please give me a hand - I'm really concerned/stressed!

Thanks :)
0
Adam
Asked:
Adam
  • 3
  • 2
1 Solution
 
deepanjandasCommented:
Your thinking is right, this is due to event listeners not being cleared properly.
Once your video is over, clear out everything, close the video stream and then proceed.

Warm Regards
Deepanjan Das
0
 
AdamAuthor Commented:
Hi Deepanjas,

Would you mind showing me how to properly clear the video using an event listener?  It's because I don't have instance names on my video, and just wondering what the syntax would be, as I'm fairly new to AS3.

Thanks very much
0
 
deepanjandasCommented:
It would be easier if you can just share your code snippet. It will be easier for me to integrate in that.

Warm Regards
Deepanjan Das
0
 
AdamAuthor Commented:
I used this code on the skip button which resolved the issue:

      intro.removeEventListener(VideoEvent.COMPLETE, fPlay);
      removeChild(intro);

Thanks for your help Deepanjan
0
 
AdamAuthor Commented:
Deepanjan confirmed my suspicions but was unable to provide syntax.  He did suggested I send a snippet of code, but that didn't make sense to me in context of the question.  I'm glad he helped me though.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now