A Sweet Feeling of Accomplishment
:::: ^__^ :::::
Monday, September 11, 2006 by Cyberium | Discussion: DesktopX
1. Make a base image i.e.

2. Make a 2nd image i.e.

3. Make a text object and assign it the DXPlayer ability - Clip Name
4. Parent the 2nd image to the base image
5. Parent the text object to the 2nd image
6. Get exact width of 2nd image (in this case it's 238 pixels)
7. Insert the following code into your text object:
'Called when the script is executed
Sub Object_OnScriptEnter
Object.SetTimer 1, 1
Object.Left = 2 'Aligns the text object 2pixels in from parent image
End Sub
Sub Object_OnTimer1
If Object.Left + Object.Width <= 236 Then ' Checks when the end of text is lined up with right edge of parent image - 2
Object.SetTimer 4, 2500 ' Pause timer
Object.KillTimer 1
Else
Object.Left = Object.Left - 1 ' if still not at right edge - carry on moving left
End If
End Sub
Sub Object_OnTimer3
Object.SetTimer 1, 1
Object.KillTimer 3
End Sub
Sub Object_OnTimer4
Object.SetTimer 2, 1
Object.KillTimer 4
End Sub
Sub Object_OnTimer2
If Object.Left => 2 Then ' Checks the text is back at starting position, 2 pixels in from left edge of parent image
Object.SetTimer 3, 2500
Object.KillTimer 2
Else
Object.Left = Object.Left + 1
End If
End Sub
'Called when the script is terminated
Sub Object_OnScriptExit
Object.KillTimer 1
End Sub
Reply #2 Monday, September 11, 2006 1:48 PM
| Thought about posting to http://scratchpad.wikia.com/wiki/DesktopX ? |
I second that! It would be a great contribution to the wiki.
Reply #6 Sunday, October 1, 2006 9:42 AM
(not being sarcastic, you are regarded as a Script GOD!)
Reply #7 Monday, October 23, 2006 8:26 AM
| Oh my God! I've got a "Nice" from RomanDA! *Is honoured* (not being sarcastic, you are regarded as a Script GOD!) |
.... waiting on some comment from Zu now..
Reply #8 Monday, October 23, 2006 8:30 AM
However, that being said, he'll probably steal your code in a heartbeat if it's better than his and he can find a way to use it.
For the record, and not to dismiss the tutorials that David has written, most of the really good DX builders here comment their code very well and there's a lot you can learn from reading what they've done.
Reply #9 Tuesday, October 24, 2006 8:59 AM
'Note: The scrolling text must be longer than scroll area for this example!
Dim onscroll,sd,xb,xe,tp,xpath
Sub Object_OnScriptEnter
desktopx.object("scrolltext").text = "ENTER SOME LONG TEXT HERE...."
onscroll = False
sd = 20 '<== a small delay between the steps of scrolling
tp = 500 '<== delay between the cycles of scrolling
xb = 0 '<== "zero" position
xe = desktopx.object("scrollback").width '<== "end" position
xpath = desktopx.object("scrolltext").width - desktopx.object("scrollback").width
desktopx.object("scrolltext").left = xb
OnScrolling_Ex
End Sub
Sub OnScrolling_Ex()
object.SetTimer 1, tp
End Sub
Sub object_OnTimer1
object.KillTimer 1
onscroll = True
object.SetTimer 2, 1 '<== this timer is need to "wake" a sleeping object
End Sub
Sub object_OnTimer2 '<== SCROLLING CYCLE (the text object will move onward/backward)
object.KillTimer 2
If onscroll = True Then
If desktopx.object("scrolltext").left = xb Then
For i = 0 To xpath
If desktopx.object("scrolltext").right > xe - 1 Then
desktopx.object("scrolltext").left = desktopx.object("scrolltext").left - 1
object.sleep sd
End If
Next
desktopx.object("scrolltext").right = xe
onscroll = False
OnScrolling_Ex
Else
If desktopx.object("scrolltext").right = xe Then
For j = 0 To xpath
If desktopx.object("scrolltext").left < xb - 1 Then
desktopx.object("scrolltext").right = desktopx.object("scrolltext").right + 1
object.sleep sd
End If
Next
desktopx.object("scrolltext").left = xb
onscroll = False
OnScrolling_Ex
End If
End If
End If
End Sub
Before use this code you need only two things:
1. Create two objects: the "srollarea" and "scrolltext" which must be joined to the "scrollarea" (Parent/Qwner)
2. Add this code to the "srollarea" object and run.
Good Luck with DesktopX

Reply #10 Tuesday, November 7, 2006 7:39 PM
i am going crazy....
Reply #11 Friday, November 24, 2006 6:02 AM
Reply #12 Thursday, May 10, 2007 10:36 PM
Otherwise it's a cool script
my modest opinion.
Reply #14 Saturday, June 14, 2008 10:31 AM
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Monday, September 11, 2006 1:43 PM