|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help !! Where does Flash keep the array from VB ??
Somebody HELP me !!! I am a newbie.
I am using Flash in VB. I am sending a series of SETVARIABLE from VB in a loop in the form of an array like vbarray[i],value(i). Flash Module: Only one timeline with one frame. I am able to view the value[i] when I assign a textbox to the variable of vbarray[i]. So, vb is sending the array and its values properly, and Flash is receiving them. Since I am unable to find out where Flash saves this array that it receives from VB, I am unable to access this array for using in code. I have tried using _root.vbarray[i], _level0._root.vbarray[i], still the vbarray.length shows zero. I am unable to use my debugger and thus unable to track it. I am willing to send the fla file if necessary Thanks much. |
|
#2
|
|||
|
|||
|
http://forums.devshed.com/t80389/s.html
check that, may help. i know nothing about VB. flash expects data in the format variable_name="blah"&variable_value="bling bling" so if you have an array, you will need to send it back as a string constructed by whatever back end, like variable_name0="blah"&variable_value0="bling bling"&variable_name1="blah"&variable_value1="bling bling"&num_rows=2 then loop through the data using the num of returned rows, a bit of a pain i know, but the only way i think it can be done
__________________
beware of geeks bearing animated gifs. |
|
#3
|
|||
|
|||
|
There is no straight way to pass a complete array from VB to Flash using 'SetVariable'. Instead, you should try passing the Array as a 'String' into Flash and then Parse this 'String - Array'.
For Example: VB Part___________________________________ Dim myArray(4) Dim stringArray myArray(1) = "This" myArray(1) = "is" myArray(1) = "my" myArray(1) = "array" For i = 0 to myArray.Count - 1 stringArray = stringArray & myArray(i) & "," 'Note: "," = delimeter Next i Call myShockwaveFlash.SetVariable("myTextFieldReceiver",stringArray) Actionscript Part_____________________________ //You should add a Listener to the TextField (never use the 'onChanged' Event as it only works with direct keyboard entries) receiving the values from VB. In Fact you could as well discard the TextField and just use a plain variable with a Listener attached to it. Sorry, no time to show you how.. (var myParsedArray = new Array; myParsedArray = myTextFieldReceiver.split(","); //Works for 1-dimension Arrays - For 2-Dimensional Arrays just use a For-Next Loop for Second Level Parsing. //Now myParsedArray should contain all values needed. //Parsing is really annoying and time consuming but there is no other way of doing it (except XML over a connection or Flash Remoting - both online - no Desktop App Methods). There is also another interesting way of passing actionscript objects (like arrays) in binary mode but you have to use a swf constructor engine (quite complicated but interesting)... Cheers... |
|
#4
|
|||
|
|||
|
...
myArray(0) = "This" myArray(1) = "is" myArray(2) = "my" myArray(3) = "array" ... |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Help !! Where does Flash keep the array from VB ?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|