def parse(self,stream): self.actions = [] while stream.peek('uintle:8') != 0: action_code = datatypes.UI8(stream) action_length = 0 if action_code > 0x7F: action_length = datatypes.UI16(stream) action_stream = stream.read('bits:{0}'.format(action_length*8)) self.actions.append(ActionFactory.new_action(action_stream, action_code, action_length))
def parse(self,stream): self.sprite_id = stream.read('uintle:16') self.actions = [] while stream.peek('uintle:8') != 0: action_code = stream.read('uintle:8') action_length = 0 if action_code > 0x7F: action_length = stream.read('uintle:16') action_stream = stream.read('bits:{0}'.format(action_length*8)) self.actions.append(ActionFactory.new_action(action_stream, action_code, action_length))
def __init__(self,stream,swf_version): self.event_flags = ClipEventFlags(stream,swf_version) self.action_record_size = stream.read('uintle:32') initial_bytepos = stream.bytepos if hasattr(self.event_flags,"clip_event_key_press") and self.event_flags.clip_event_key_press == True: self.key_code = stream.read('uintle:8') self.actions = [] while stream.bytepos < initial_bytepos + self.action_record_size: action_code = stream.read('uintle:8') action_length = 0 if action_code > 0x7F: action_length = stream.read('uintle:16') action_stream = stream.read('bits:{0}'.format(action_length*8)) self.actions.append(ActionFactory.new_action(action_stream, action_code, action_length) )