| View previous topic :: View next topic |
| Author |
Message |
Meeman Advanced Cheater
Reputation: 0
Joined: 15 Nov 2007 Posts: 54
|
Posted: Sat Jan 12, 2008 9:12 pm Post subject: question |
|
|
hey guys,
just a quick question:
i want to search a shockwave flash that i load into a form and then get the values of multiple variables in a list box.
If you dont understand i want to have a list box that when a button is clicked it will find the value to the shockwave flash's variables score, health and nickname. Whats the code to have it get all these variables and post the values in a listbox?
the code can be in VB, C# or Delphi since i'm pretty familiar with each
thanks
-MEEMAN666
_________________
I AM MEEMAN666!!!!!!!!!!
PPT277
programming languages i use: VB6, Delphi 7 , C# 2008, Python
You want to +Rep me!!!!!!! |
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Wed Jan 16, 2008 4:30 pm Post subject: Re: question |
|
|
| Meeman wrote: | hey guys,
just a quick question:
i want to search a shockwave flash that i load into a form and then get the values of multiple variables in a list box.
If you dont understand i want to have a list box that when a button is clicked it will find the value to the shockwave flash's variables score, health and nickname. Whats the code to have it get all these variables and post the values in a listbox?
the code can be in VB, C# or Delphi since i'm pretty familiar with each
thanks
-MEEMAN666 |
So u want the program to automatically find the variables? Well that ain't possible unless you debug the movie.
If you on the other hand allready got the variables then you can use get variable thing.
| Code: | | text1=ShockwaveFlash1.GetVariable ("tönt")[ |
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Wed Jan 16, 2008 11:07 pm Post subject: |
|
|
Loop through the list and poll the flash object with each object. You can loop the list items by doing something like:
| Code: | Private Sub Command1_Click()
Dim x As Long
For x = 0 To (List1.ListCount - 1)
MsgBox List1.List(x)
Next x
End Sub |
Which will msgbox each items string. Just for example.
In turn you can make a poll function to request the data from the flash object. If the GetVariable function fails, it usually means the variable does not exist in the flash object. So be sure to add error handling or the program will crash. So you can do something like:
| Code: | Private Function GetVar(strVar As String) As String
On Error GoTo ErrHand
Dim strReturn As String
ShockwaveFlash1.GetVariable strVar
GetVar = strReturn
Exit Function
ErrHand:
GetVar = ""
End Function |
Then inside your loop you would use something such as:
| Code: | Private Sub Command1_Click()
Dim x As Long
For x = 0 To (List1.ListCount - 1)
Text1.Text = GetVar(List1.List(x))
Next x
End Sub |
Change Text1.Text to what ever you want to store the var, and make an array of textboxes if you want more then one.
_________________
- Retired. |
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Thu Jan 17, 2008 2:12 am Post subject: |
|
|
| Wiccaan wrote: | Loop through the list and poll the flash object with each object. You can loop the list items by doing something like:
| Code: | Private Sub Command1_Click()
Dim x As Long
For x = 0 To (List1.ListCount - 1)
MsgBox List1.List(x)
Next x
End Sub |
Which will msgbox each items string. Just for example.
In turn you can make a poll function to request the data from the flash object. If the GetVariable function fails, it usually means the variable does not exist in the flash object. So be sure to add error handling or the program will crash. So you can do something like:
| Code: | Private Function GetVar(strVar As String) As String
On Error GoTo ErrHand
Dim strReturn As String
ShockwaveFlash1.GetVariable strVar
GetVar = strReturn
Exit Function
ErrHand:
GetVar = ""
End Function |
Then inside your loop you would use something such as:
| Code: | Private Sub Command1_Click()
Dim x As Long
For x = 0 To (List1.ListCount - 1)
Text1.Text = GetVar(List1.List(x))
Next x
End Sub |
Change Text1.Text to what ever you want to store the var, and make an array of textboxes if you want more then one. |
List1.ListCount - 1?
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Jan 17, 2008 10:34 pm Post subject: |
|
|
The list count returns the number of "true" items in the list, not starting with 0. However, List1.List( <item number> ) starts with 0. If you do 0 to ListCount you will get an error due to it attempting to get an item that doesn't exist in the list.
_________________
- Retired. |
|
| Back to top |
|
 |
stealthy17 Expert Cheater
Reputation: 0
Joined: 10 Apr 2007 Posts: 144 Location: The Netherlands
|
|
| Back to top |
|
 |
|