stop function in middle
- Started
- Last post
- 20 Responses
- jpea
anyone know of a way to stop a function in flash midway and not execute the rest of the function?
- Bottlerocket0
this.myfunction = null
- jpea0
thanks, but it still performs a trace way down in the function.
- Bottlerocket0
I am not really a code junky, but aren't all items within a function executed at once?
- jpea0
nope, they're executed down the list, so you could call another function at the top and return a value and use it later on down the function.
- Bottlerocket0
whoops, wrong thread....
- Bottlerocket0
what about:
delete this.myFunction
- Bottlerocket0
sorry mate, I am really guessing here.
- Bottlerocket0
just use: return
- alloyd0
break;
:)
- gabriel20
yeah, return false;
- UndoUndo0
use
break;
that will stop all code rnning further in the function
- jpea0
thanks all, but it doesn't seem to work
- joyride0
doesn't break; need to be withing a case statement? I thought I tried this in a function and it didn't work?
Also, why do you want it to stop?
- jpea0
i'd want it to stop if it hits an if statement, then it sets an interval for another function to start.
- joyride0
check what I posted
- UndoUndo0
see changes
- joyride0
sorry undo, If you changed anything i might have undo'd it. =(
- jpea0
ah, shoulda known it was that simple. thanks
- UndoUndo0
haha - no worries - i think we were posting at teh same time. anyways i think it works now? and im sure we were both doing the same thing.
examples incase
case "myString" :
//(matches "myString")case 1 :
//(matches the number 1)case myString :
//(matches the object myString note no quotation marks