Firefox 3 Release & Stardock Site Compatibility
Jul 30, 2008 12:59

Firefox 3.0 goes final and is scheduled for release on Tuesday, June 17th.

There are currently known incompatibilities between Firefox 3 and many of our sites and forums. For the most part, the sites function properly, but have formatting issues. A specific example are the login & password fields to log into these forums. In Firefox 3, instead of both being on the same line, they are stacked vertically.

We will be addressing these visual issues in time. Please do NOT post threads on the forums pointing out Firefox 3 site issues. They will be deleted. We are aware of the problems and will work as quickly as we can to resolve them.

Until posted otherwise, the only version of Firefox our sites support at the moment is Firefox 2.

Image Animation Script help needed (Solved)

By Posted May 22, 2008 09:02:22
I need help in making a animation script, What I'm trying to do is make an infinitely repeating animated image from a sprite strip that I have all ready made (20 Frames) to run on the desktop. Normally I would just use the animation feature but I need to change the duration of most the the frames (see below) to maintain the proper movement of the animated image. Any help would be greatly appreciated.

Frame 1:        200ms
Frame 2-5:       10ms
Frame 6:        100ms
Frame 7-9:       10ms
Frame 10:        12ms
Frame 11:        15ms
Frame 12:        25ms
Frame 13-14:     8ms
Frame 15:          0ms
Frame 16:          6ms
Frame 17:          0ms
Frame 18-20:     5ms
Repeat:         Infinite
0 Karma 7 Replies 3 Referrals
May 22, 2008 13:38:53
There are a few ways to do what you want. I didn't test this code however I'm sure that it will work.

Dim num,td '<== frame number and time delay

Sub Object_OnLButtonUp(x,y,dragged)
If Not dragged Then
num = 1 : SetKey(1)
End If
End Sub

Sub SetKey(n)
Select Case n
Case 1 td = 200
Case 2,3,4,5 td = 10
Case 6 td = 100
Case 7,8,9 td = 10
Case 10 td = 12
Case 11 td = 15
Case 12 td = 25
Case 13,14 td = 8
Case 15,17 td = 0
Case 16 td = 6
Case 18,19,20 td = 5
End Select
If td > 0 Then Object.SetTimer 1,td Else Object_OnTimer1
End Sub

Sub Object_OnTimer1
Object.KillTimer 1
desktopx.object("frame").state = num '<== state names from 1 to 20
If num < 20 Then num = num + 1 Else num = 1
Call SetKey(num)
End Sub

As well as you may create the array with path to each of your images:

Dim frame(20),num,td

Sub Object_OnScriptEnter
For n = 1 To 20
frame(n) = "C:\My Pictures\image"&n
Next
End Sub

then use this code to change frames:

Sub Object_OnTimer1
Object.KillTimer 1
desktopx.object("frame").picture = frame(num)
If num < 20 Then num = num + 1 Else num = 1
Call SetKey(num)
End Sub

Best Regards.   
May 22, 2008 17:17:14
Vad_M, Thanks for the time to help me. I tried the first part of your script as that is what I am aiming at but have yet to get it to work, I did change "frame" to the ObjectId that I set "Test1" but it didn't work. I did notice that the last two If statements did not have End If at the end but that did not fix it I also tried reformatting the last two If statements with End If but that didn't help either.

Here is a Simple Test Image and a dxpack of the Script using the Test Image


Test1.png


www.myminifile.com Test1.dxpack
Sign Up or Login and this ad disappears!
There are many great features available to you once you register. Sign Up for a free account and browse the forums without ads.
May 23, 2008 04:11:15
No any problems!

1. Set the object width/height to 100 (in the 'Summary' tab) - your frame size is 100 x 100.
2. Copy and paste this code into the object:

Dim num,td '<== frame number and time delay

Sub Object_OnScriptEnter
object.CurrentFrame = 0
End Sub

Sub Object_OnLButtonUp(x,y,dragged)
If Not dragged Then
num = 0 : SetKey(0)
End If
End Sub

Sub SetKey(n)
Select Case n
Case 0 td = 200
Case 1,2,3,4 td = 10
Case 5 td = 100
Case 6,7,8 td = 10
Case 9 td = 12
Case 10 td = 15
Case 11 td = 25
Case 12,13 td = 8
Case 14,16 td = 0
Case 15 td = 6
Case 17,18,19 td = 5
End Select
If td > 0 Then Object.SetTimer 1,td Else Object_OnTimer1
End Sub

Sub Object_OnTimer1
Object.KillTimer 1
object.CurrentFrame = num '<== state names from 0 to 19
If num < 19 Then num = num + 1 Else num = 0
Call SetKey(num)
End Sub

3. Enjoy.   
May 23, 2008 09:27:30
It works! Thank you Vad_M. I did need need to change a few things like removing Object_OnLButtonUp and moving its contents to Object_OnScriptEnter to start animation on load instead of on left click nothing major. The other thing I changed was actually my fault to begin with, the delay time as it was running way to fast. I realized that the duration that wrote down was supposed to be 1/100 not 1/1000 of a second, adding a extra zero to my time fixed that. And the last thing I changed was the frame numbers in Sub SetKey(n) as for sum reason even though that DesktopX: Scripted Animations tells that frame numbers start with zero that my animation would delay one frame too early, changing it so that it starts with One instead of Zero fixed that problem. After that the script was fully working for me.


Code: vbscript
Dim num,td ' 0 Then Object.SetTimer 1,td Else Object_OnTimer1
End Sub

Sub Object_OnTimer1
Object.KillTimer 1
object.CurrentFrame = num '<== state names from 0 to 19
If num < 19 Then num = num + 1 Else num = 0
Call SetKey(num)
End Sub
May 23, 2008 09:47:14
Oops, In the last post the script didn't post correctly so here it is again.


Dim num,td '<== frame number and time delay

Sub Object_OnScriptEnter
object.CurrentFrame = 0
num = 0 : SetKey(0)
End Sub

Sub SetKey(n)
Select Case n
Case 1 td = 2000
Case 2,3,4,5 td = 100
Case 6 td = 1000
Case 7,8,9 td = 100
Case 10 td = 120
Case 11 td = 150
Case 12 td = 250
Case 13,14 td = 80
Case 15,17 td = 0
Case 16 td = 60
Case 18,19,20 td = 50
End Select
If td > 0 Then Object.SetTimer 1,td Else Object_OnTimer1
End Sub

Sub Object_OnTimer1
Object.KillTimer 1
object.CurrentFrame = num '<== state names from 0 to 19
If num < 19 Then num = num + 1 Else num = 0
Call SetKey(num)
End Sub
May 23, 2008 16:18:33
I'm glad that all okay now.   

Have a nice day with DesktopX!
Stardock Forums v1.5.3099.12923
© 1995-2008 Stardock Corporation. All rights reserved.
All times are EST. The time is now 00:34:34
Server Load Time: 00:00:00.0000016   Page Render Time: