Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Orilla

myTimeline.seek(position) if an image is loaded

Recommended Posts

Hi, 

 

I'm jumping between pages with different timelines, it's all ok, till the moment i go back to the first page (to the point it was before left) using seek function.

 

myTimeline.seek(lastposition);

 

where lastposition it is the position before the page was changed. I can easily check the value of that variable, lastposition, and it is right, but the seek function doesn't really jumps to that position, but a bit before, like 0.3 sec aprox, depending on how many images needs to load till that lastposition.

 

Even forcing the lastposition to 1, the seek function do not jumps there, but a bit before.

 

Why this is happening? 

Link to comment
Share on other sites

Hi and welcome to the GreenSock Flash forum,

 

I'm having difficulty understanding by what you mean by jumping to different pages.

Do you mean different HTML pages that load or different frames of a Flash movie?

I ask because Flash doesn't really have pages.

 

Either way a very basic demo that clearly illustrates the issue would be of great help.

seek() should be extremely accurate, always. 

Link to comment
Share on other sites

Hi Carl,

 

Thanks for your reply. I'm working just with flash.

 

I have a main page with an index on the side, so you can click the index at any time, and it will takes you to a lets say a subpage. From there, you can go back to the main page. Page and subpage(s) has their own timeline.

So the issue arise when i'm coming back to the main page from a subpage. I want to come back to the same timeline position where it was before jumps to the subpage, so i created a backPosition variable, where this value is kept, and then used seek(backPosition) to positioning back in the main page timeline.

 

timelineMainPage.seek(backPosition)

 

This works fine in general cases, but not when there are images on the main page to load (loading with ImageLoader)

In that cases, the timeline doesn't really go to that backPosition, but a bit before. 

 

This is a log, where i plot the value of backPosition variable, and the value of the timelineMainPage.progress() after the seek(backPosition) is executed. Also i tried using labels having the same issue (goes to the label just before the wished one)

 

BACK to Main: backPosition:1, timeline current progress:0.6666666666666665

BACKto Main: backLabel: [frame4], Current label: [frame3]

 

As i said, this is happening just when images are loaded. 

Link to comment
Share on other sites

Thanks for the extra details, unfortunately I still don't have anything that I can test or troubleshoot.

I really don't understand how an ImageLoader would hinder a timeline.seek() from working accurately.

if you can provide a sample fla with only the code and assets necessary to replicate the problem, we will look at it.

 

Please zip the fla and attach it to this post using the "more reply options" button.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×