1 Reply Latest reply on Feb 4, 2011 8:57 AM by Flex in a Week, FiaW

    I get the error 1120, whats wrong?

    haack5 Level 1

      <?xml version="1.0" encoding="utf-8"?>

      <mob:ScreenStackApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"

         xmlns:mob="openplug.elips.controls.*" xmlns:screen="openplug.elips.controls.screenClasses.*" creationComplete="init()">

       

      <mx:Style>

      .myStyle

      {

      color-scheme: blueStyle;

      }

      </mx:Style>

       

      <mx:Style source="variantstyle.css"/>

       

      <mx:Script>

      <![CDATA[

      import mx.controls.Label;

       

      import openplug.elips.controls.Alert;

       

      [Bindable]

      private var myCollection:ArrayCollection = new ArrayCollection(null);

       

      private function completeHandler(event:Event):void {

      var loader:URLLoader = URLLoader(event.target);

      var xml:XML = XML(loader.data);

      for each (var tag:XML in xml..Country) {

      var myLabel:Label = new Label();

      myLabel.text=String(tag..Country_Name) + ": +" + String(tag..Country_Code);

      myLabel.height=height*10/100;

      myCollection.addItem(myLabel);

      }

      actReq.stop();

      actReq.visible=false;

      }

       

      Here is something wrong

       

       

      "

       

      private function errorHandler(event:IOErrorEvent):void {

      Alert.show(event.toString(),"Connection Error");

      actReq.stop();

      actReq.visible=false;

      }

       

      "

      I get the alert on the alert.show .

       

       

       

       

       

      private function init():void {

      var urlLoader:URLLoader = new URLLoader();

      urlLoader.load(new URLRequest("http://developer.openplug.com/twitter_app/country.xml"));

      urlLoader.addEventListener(Event.COMPLETE,completeHandler);

      urlLoader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);

       

      }

       

      ]]>

      </mx:Script>

       

      <!-- Screen definition, you can have several screens in a screen stack -->

      <mob:ScreenView id="myFirstScreen">

       

      <!-- Soft Key Button Bar, will be visible on Windows Mobile and Symbian -->

      <mob:softKeyBarDescriptor>

      <screen:SoftKeyBarDescriptor leftAction="Left" rightAction="Right"

        leftActionClick="trace('LEFT')" rightActionClick="trace('RIGHT')"/>

      </mob:softKeyBarDescriptor>

       

      <!-- Navigation Bar, will be visible on iPhone -->

      <mob:navBarDescriptor>

      <screen:NavigationBarDescriptor title="My Screen" leftActionClick="trace('LEFT')" leftAction="Left" styleName="myStyle">

      <screen:rightAction>

      <mob:ActivityIndicator id="actReq" width="30" height="30" autoStart="true" color-scheme="light"/>

      </screen:rightAction>

      </screen:NavigationBarDescriptor>

      </mob:navBarDescriptor>

       

      <!-- Menu Provider, will be shown when pressing MENU key on Android -->

      <mob:menuProvider>

      <mx:ArrayCollection>

      <screen:MenuItem actionClick="trace('item 1')" label="Action1"/>

      <screen:MenuItem actionClick="trace('item 2')" label="Action2"/>

      <screen:MenuItem actionClick="trace('item 3')" label="Action3"/>

      </mx:ArrayCollection>

      </mob:menuProvider>

       

      <!-- Tab Navigator with two tab pannels -->

      <mob:TabNavigator id="mainTab" width="100%" height="100%">

      <mx:VBox width="100%" height="100%" horizontalGap="0" verticalGap="0" horizontalAlign="center" verticalAlign="middle" label="Tab 1">

      <mob:List id="myList" dataProvider="{myCollection}" rowHeight="30" width="100%" height="100%" />

      </mx:VBox>

      <mx:VBox width="100%" height="100%" horizontalGap="0" verticalGap="0" horizontalAlign="center" verticalAlign="middle" label="Tab 2">

      <mx:Text width="100%" text="{'This is my first application for ' + openplug.elips.device.Capabilities.getDeviceCapabilities().model}" textAlign="center"/>

      </mx:VBox>

      </mob:TabNavigator>

       

      </mob:ScreenView>

       

      </mob:ScreenStackApplication>