We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Displaying next record in actionscript

ccpl
ccpl asked
on
Medium Priority
201 Views
Last Modified: 2013-11-11
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

Comment
Watch Question

try it this way and let me know how it works

GE

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

Open in new window

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

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

the problem must be at some other point.

Author

Commented:
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

Author

Commented:
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

Author

Commented:
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
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.