Made to Order Software Corporation Logo

Branch If True

SWF Action
Action Category: 
Control
Action Details: 
0
Action Identifier: 
157
Action Structure: 
signed short   f_offset;
Action Length: 
2 byte(s)
Action Stack: 
pop 1 (b)
Action Operation: 
b1 := pop();
if(b1) {
    ip += f_offset;   // ip past the branch action
}
Action Flash Version: 
4
See Also: 

Pop a Boolean value; if true then jump to the specified action; otherwise continue with the following actions.

There is no Branch If False action. Instead, first use the Logical Not, then Branch If True.

IMPORTANT NOTES

The offset, which is defined in bytes, must be such that when added to the current instruction pointer it points to a valid action (i.e. you cannot jump in the middle of a Push Data or any other such action.)

The offset cannot point outside of the current block of execution, although it can branch to the very end of the block. So if you are inside a With or Try block, a Branch If True cannot be used to exit that block. This can be a problem if you are trying to implement some advanced functionality in an ActionScript compiler such as a goto instruction.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.