Hi, I'm trying to call a function and pass a couple of properties to it however it's complain the object i'm attempting to target is null. Can anyone see where I am going wrong?
<mx:ViewStack id="vs" width="100%" height="100%" y="53">
<mx:Canvas id="view1" label="Community" width="100%" height="100%" backgroundColor="#ff9900" showEffect="WipeDown" hideEffect="WipeUp">
<mx:Label text="Community"/>
</mx:Canvas>
<mx:Canvas id="view2" label="Apps" width="100%" height="100%" backgroundColor="green">
<mx:HTML id="myHTML" width="100%" height="100%"
visible="true"
paintsDefaultBackground="true"
htmlRender="browser_completeHandler(event)"
locationChange="browser_locationChangeHandler(event)"
complete="browser_completeHandler(event)" />
</mx:Canvas>
</mx:ViewStack>
<local:DockBar id="dockbar" horizontalCenter="0" bottom="0" width="100%" height="100" minSize="32" maxSize="80">
<mx:Label visible="false" id="menuLabel" text="Menu" bottom="0" horizontalCenter="0" fontSize="24" color="#ffffff" alpha=".75" />
<mx:Image click="gotoApp('Google','http://www.google.com/')" source="{icon1}" buttonMode="true" useHandCursor="true" toolTip="Nice red" rollOver="turnOn(event)" rollOut="turnOff(event)" />
<mx:Image click="gotoApp('Yahoo','http://www.yahoo.com/')" source="{icon2}" buttonMode="true" useHandCursor="true" toolTip="Cool orange" rollOver="turnOn(event)" rollOut="turnOff(event)" />
</mx:HBox>
</local:DockBar>
and the function looks like this:
private function gotoApp(id:String,url:String):void {
vs.selectedChild=view4;
trace(myHTML);
}
It's returning null the first time I click an image however subsequent attempts traces a value (I assume because it is set then, just not when the app loads). Any ideas how to recognize it when the app loads?
Cheers