AS3 code in External swf not working in AIR 3.6 with iOS
Hi all, I'm struggling as everybody said it works with AIR 3.6, but no one explain how to get it work. My testing is very straight forward, my main swf file is loading an external swf file (ball.swf). In the ball.swf, at frame 1, I have these code:
var nCounter:uint = 0;
tbCount.text = String(nCounter);
function countUpdate():void{
nCounter++;
tbCount.text = String(nCounter);
if (nCounter==6){
this.mcBall.stop();
}//if
trace (nCounter)
}//function
At frame 60 of ball.swf, I have these code:
countUpdate();
gotoAndPlay(2);
So the ball.swf basically is just a ball animation that suppose to repeat until it is repeated 7 times. I have a text box to display the counter.
On the desktop, everything is fine but once installed to the iPad mini, it's not.
I have overlayed AIR 3.6 to my Flash Pro CS 5.5. I package everything into and ipa file (tried setting like Quick publishing, Deployment etc). The ball.swf loads and I can see the ball.swf animate in the ipad mini, but the AS code in it is not working, the counter never increase and the animation never stops.
I even tried ADT to make sure I package in AOT ipa. What am I'm doing wrong?
I have a button in my main swf, and once the button is pressed, this is how I load the ball.swf:
function LoadBtn_onRelease (evt:MouseEvent):void{
var _urlRequest:URLRequest = new URLRequest("ext_grayBall.swf");
var _loader:Loader = new Loader();
var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
_loader.contentLoaderInfo.addEventListener (Event.COMPLETE, loader_onComplete);
_loader.load(_urlRequest, _lc);
}//function
Any help would be appreciated. My company is not going to upgrad to CS 6 for a long time as IT do not like Cloud software.
The overlay process with CS 5.5 is a bit unclear, but my Airiphone.xml in the \common]configuration\players\airiphone.xml look like this:
<player id="PFI1_0" version="19" asversion="3" minasversion="3">
<name>AIR for iOS</name>
<publishobject2 id="Air2_5" version="3.6" intversion="3.6"></publishobject2>
<path platform="WIN">Air2_5.dll</path>
<path platform="MAC">Air2_5.bundle</path>
....
So I think it's not the problem of swf Version that everybody said it has to be version 19 for the main swf to be able to load external swf.
Thanks in advance!
