So that comes down to 

function(a:String, b:String, c:String, d:String):uint {

return a.charCodeAt(0) << 24 | b.charCodeAt(0) << 16 | c.charCodeAt(0)
<< 8 | d.charCodeAt(0);

}

thanks :)

And no not for DeluxePaint, I'm trying to read Sims 1 object files into
Flash, which are also encoded in IFF

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David
Holroyd
Sent: 10 May 2007 12:42
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] IFF to AS3

On Thu, May 10, 2007 at 10:06:27AM +0200, Frank Pepermans wrote:
> I'm trying to get AS3 to parse an IFF file, more specifically the EA
IFF
> 85 file format, using the byteArray.
> 
> For now the best documentation I've found is this link
> http://www.martinreddy.net/gfx/2d/IFF.txt and a C script called
> IFFDigest.
> 
>  
> 
> Now since I've never done anything in C, there are some sections in
the
> code which aren't exactly clear, for example :
> 
>  
> 
> /* ID typedef and builder for 68000 Lattice C. */
> typedef LONG ID;       /* 4 chars in ' ' through '~'  */
> #define MakeID(a,b,c,d) ( (a)<<<<24 | (b)<<<<16 | (c)<<<<8 | (d) )
>  
> /* Globally reserved IDs. */
> #define ID_FORM   MakeID('F','O','R','M')
> #define ID_LIST   MakeID('L','I','S','T')
> #define ID_PROP   MakeID('P','R','O','P')
> #define ID_CAT    MakeID('C','A','T',' ')
> #define ID_FILLER MakeID(' ',' ',' ',' ')

This code is taking the four 8-bit-bytes of the IDs and assembling them
into a single 32-bit value.

i.e. it turns "F"-"O"-"R"-"M" into 0x464F524D.  This is presumably an
optimisation so that it can compare ID values a whole 32-bit-word at a
time, rather than requiring four byte-wise comparisions.

Are you porting DeluxePaint to Flash? ;)


ta,
dave

-- 
http://david.holroyd.me.uk/
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to