0 Replies Latest reply on Jul 1, 2014 12:21 AM by Sharmi_07

    Usage of Navigator.pushView in actionscript class

    Sharmi_07 Level 1

      Hi,

      Is that possible to use navigator.pushView in my as3 class to view the mxml component? I tried using the below code but it doesn't throw me any error nor moved to the view page. So how can I view the mxml component from the as3 class?


      My as3 class: testingas3.as

      package views
      {      
              import spark.components.View;

              public class testingas3 extends View
              {
                     public function testingas3()
                     {
                           navigator.pushView(views.test);
                     }
              }
      }

      My view component: test.mxml

      <?xml version="1.0" encoding="utf-8"?>
      <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark" title="Streaming">
              <fx:Script>
                     <![CDATA[
                     ]]>
              </fx:Script>
              <fx:Declarations>
                     <!-- Place non-visual elements (e.g., services, value objects) here -->
              </fx:Declarations>
              <s:Button label="Hi click here!"/>
      </s:View>

       

      Thanks,

      Sharmi.