3 Replies Latest reply on Mar 13, 2007 3:31 PM by poze9

    Please Help with Viewstack and custom component

    poze9
      I'm having trouble trying to embed a component within a viewstack. I have my main applicaiton main.mxml application and the calander control from quietly scheming (app.mxml) is the component. The issue I'm having is how to have the calendar show within my viewstack canvas. The app.mxml file namespaces below:

      <?xml version="1.0" encoding="utf-8"?>
      <local:app_code xmlns:local="*" xmlns=" http://www.adobe.com/2006/mxml" xmlns:qs="qs.controls.*" xmlns:g="qs.graphics.*"
      xmlns:qc="qs.containers.*"
      creationComplete="load();" xmlns:ns1="qs.containers.*" xmlns:effects="qs.effects.*" width="100%" height="100%" layout="absolute">

      <Style source="calendar.css" />
      <Style source="styles.css" />
      <Script source="app_imports.as" />
      </local>

      My application main.mxml has different namespaces:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application
      xmlns:mx=" http://www.adobe.com/2006/mxml"
      initialize="showLogin();"
      layout="absolute"
      horizontalGap="0"
      horizontalAlign="center"
      cornerRadius="20"
      xmlns:controls="com.adobe.ac.controls.*"

      >
      </application>

      If I take the code out of app.mxml and plae it on my viewstack canvas, I get all types of errors referencing functions or components in the other namespaces.

      Does this make any sense ? I just want to view the calendar in the viewstack.

      Please help
        • 1. Re: Please Help with Viewstack and custom component
          babo_ya Level 3
          if your app.mxml contains application tag which it looks like it does then you can't just take the code out of app.mxml and place it on your viewstack. I don't quiet understand what you are trying to do. but, i do this all the time, I create custom canvas/hbox/vbox and place them into viewstack object.
          • 2. Re: Please Help with Viewstack and custom component
            Josh Johnson Level 1
            Like babo_ya said, one application can't be embedded within another application as a component. What you can do is change your app.mxml file so that instead of starting with Application tags, it instead starts with a container (think Canvas, HBox, or VBox). Once you do that, then the app.mxml can be referenced as a component within your main.mxml application.
            • 3. Re: Please Help with Viewstack and custom component
              poze9 Level 1
              I guess I'm just not understanding the difference betweeen the <local:app_code> in the app.mxml file and the <mx:Application> in my main application.

              If I run the app.mxml by itself, everything is fine. if I try to take the code out and past it within the viewstack canvas I get reference errors. It can't find the objects/functions from the <local:app_code> namespace.

              I guess I'm just confused on how to structure the entire application.

              Thanks all for your responses.