Solved

Flash timeline jumps unexpectedly CS5 AS3

Posted on 2011-03-17
5
309 Views
Last Modified: 2012-05-11
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
Comment
Question by:Adam
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
deepanjandas earned 500 total points
ID: 35156654
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
 
LVL 1

Author Comment

by:Adam
ID: 35157060
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
 
LVL 17

Expert Comment

by:deepanjandas
ID: 35162096
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
 
LVL 1

Author Comment

by:Adam
ID: 35183046
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
 
LVL 1

Author Closing Comment

by:Adam
ID: 35183084
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now