[swfmill] declaring moredimensional arrays?

daniel fischer dan at f3c.com
Tue Jul 25 05:08:32 EDT 2006


Timo Dinkler <tdinkler at meuter.de> (on Tue, 25 Jul 2006 10:54:22 +0200):

  > 		</PushData>
  > 		<DeclareArray/>
  > 		<SetVariable/>
  > 			
  > 		<EndAction/>

at the end, you'll need *two* DeclareArrays, and have to be careful with the names (for SetVariable) and StackIntegers (defining how many elements the array has)... Try like so:
<DoAction>
	<actions>
		<PushData>
			<items>
				<StackString value="arrayData"/>
				<StackString value="four"/>
				<StackString value="three"/>
				<StackString value="two"/>
				<StackString value="one"/>
				<StackInteger value="4"/>
			</items>
		</PushData>
		<DeclareArray/> 
		<PushData>
			<items>
				<StackString value="4"/>
				<StackString value="3"/>
				<StackString value="2"/>
				<StackString value="1"/>
				<StackInteger value="4"/>
			</items>
		</PushData>
		<DeclareArray/>
		<PushData>
			<items>
				<StackInteger value="2"/>
			</items>
		</PushData>
		<DeclareArray/>
		<SetVariable/>
			
		<EndAction/>
	</actions>
</DoAction>


(this is untested). 

observe:
- the first <PushData> still features the StackString "arrayData". That will be used as the variable name in the final <SetVariable>
- the second <PushData> doesn't feature a string, just the four (to-be) array elements and the number "4" (for the number of elements in the second array).
- in the third, we're just pushing a 2 (=number of elements in the "top" array). just before the last <DeclareArray>, the stack should look like:
  string "arrayData"
  array [one, two, three, four] (or the other way round)
  array [1, 2, 3, 4] (or the other way round)
  integer "2"

the final DeclareArray should make a new array of the two arrays. finally, SetVariable should assign that new array to the name "arrayData".

hth,
-dan


-- 
http://0xDF.com/
http://iterative.org/



More information about the swfmill mailing list