Flash Command action error
June 14, 2007 12:00 AM
Everything sent to flash will be in strings. You have to take them and convert them into numbers - for example://actionscript codevar setFromLectora;var convertToNumber;this.onEnterFrame = function(){convertToNumber = parseInt(setFromLectora); if(convertToNumber != undefined){ //do your calculations here with the convertToNumber var }}[/CODE]What happens here is in flash you have two empty variables. Then a frame loop is set up so if you set a variable using Lectora Flash will realize it's been changed, convert it from a string to a number, and do something with it. You may not need to do all of this though if you are just trying to set a variable when the .swf loads. If so, then just use the parameters tab. If this doesn't help give some more details about what you are trying to do.[CODE]//actionscript codevar setFromLectora;var convertToNumber;this.onEnterFrame = function(){convertToNumber = parseInt(setFromLectora); if(convertToNumber != undefined){ //do your calculations here with the convertToNumber var }}[/CODE]What happens here is in flash you have two empty variables. Then a frame loop is set up so if you set a variable using Lectora Flash will realize it's been changed, convert it from a string to a number, and do something with it. You may not need to do all of this though if you are just trying to set a variable when the .swf loads. If so, then just use the parameters tab. If this doesn't help give some more details about what you are trying to do.
Discussions have been disabled for this post