Swiffy Input Textfield Workaround
Solution 1:
Thanx to your anwser and using the code you posted I made another working demo for a flash file in actionscript 2, to interchange data between swiffy and javascript (in and out).
Here are the steps:
1) The key is to send the value to the swiffy object with this line in javascript:
function sendValue() { myValue=inputFieldName.value; stage.setFlashVars('myMessageFromTextfield='+myValue); }
2) Then, inside the fla file, in actionscript2, get the value:
getValue = function() { if(_level0.myMessageFromTextfield == "undefined" || _level0.myMessageFromTextfield == undefined) { this.cat.animCat.myText.text = ""; } else { this.cat.animCat.myText.text = _level0.myMessageFromTextfield; returnButton._visible = true; } }
3) We need to constantly monitor when te data apears so use a setInterval:
myInterval = setInterval(this, "getValue", 100);
4) Now, to send the value back to html file, we use getURL with the data attached:
returnButton.onRelease = function() { getURL("Javascript:showMessage('"+_level0.myMessageFromTextfield+" says the cat');"); }
5) And finally, again in javascript inside the html we execute the function with the parameter:
function showMessage(message) { alert(message); }
It works perfectly in IE, Firefox, Chrome, safari (ios).
So now we can send text in ipad or iphone.
I attached the source files in the next link:
Post a Comment for "Swiffy Input Textfield Workaround"