Link to home
Start Free TrialLog in
Avatar of ccpl
ccpl

asked on

Displaying next record in actionscript

I have built a flash program using the one on this web site
http://www.15seconds.com/Issue/010605.htm as a base and I am not very knowledge on action scripting to make it do what I am looking to do. Right now to navigate there is a forward  buttons which will bring up the next record up, but I would like it to after a set time display the next record by itself. I tried the code shown here which is the best i been able to come up with. I am not sure if I am on the right track on not, any help would be appreciated.

function myfunction() {
	clearInterval(myInterval);
	CurrentRecord++;
	if (CurrentRecord == TotalRecords) {
		CurrentRecord = 0;
	}
	loadVariables("getdetails.asp?Record="+(CurrentRecord), this);
}
 
myInterval = setInterval(myfunction, 6000);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Eaddy Barnes
Eaddy Barnes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ccpl
ccpl

ASKER

nope no effect
Your timing Function is working fine on its own.

the problem must be at some other point.

Avatar of ccpl

ASKER

it seem to work now if i publish it using flash version 6, but i lose some of my html i have in my program, and if i publish in version 8 i gain my html stuff but lose the timing part
i am not sure where the problem is coming from my skill in asp is limited at best.
do you have to use asp. would you consider useing xml for you importing of data.
GE
Avatar of ccpl

ASKER

i know asp that why i am using it, and also i need it for the back end stuff i can create. The asp part of the flash works fine. Only problem really is that this one scirpt will not work when i publish it anything other then flash 6, and i need to publish it in flash 7 or 8
ok i understand.

if another experts does not come up with anything to help you. the following is what i did when i needed a timer when i could not use action script very well.

1. i would create a moveClip off stage and call it timer.(timer_mc)
2. i would extend that timeline within that movie clip to reflect the length of time i needed per intervals(lets say 6 sec)
3. i would place the code i would want to be execute at the last frame of the time line
4. when i wanted the time loop to start i would just have the movie clip play(); and every time it reaches to the last frame the script would run.
5. if i needed the timer to stop i would just type TimerClip gotoAndStop(1);

its not script but it works

do you understand what i mean?

GE
Avatar of ccpl

ASKER

I have figured out that the script has been working, but not correctly. In flash 6 it will return 1,2,3,4,5 as it should, but in flash 7 and above it returns, 1,NAN,NAN,NAN,NAN. I have tried what u suggected with the movie clip and it still does the same thing, so maybe this is another problem?
Yea i would say it is. because 2 timing events cant be wrong considering the first one was ok.

i would advise that you ask another question targeting the asp aspect of your program. and

 include asp as one of the zones it will show up on

Good Luck

GE