3 Replies Latest reply on Jan 26, 2010 6:12 PM by StealthRTTT

    Flash Builder 4 flashvars help

    StealthRTTT

      Hey all i am new at this flash builder thing and had a coder help me out with designing a program for my needs. He's out of town right now and not able to help me out so i had desided to see if anyone on this forum could help me out instead. I seem to be having problems with passing flashvars from the html page to the flash builder program. Here is the code i have that *should* have worked since it came from a website with a working demo.

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

       

      <s:Group

       

       

      xmlns:fx="http://ns.adobe.com/mxml/2009"

      xmlns:s="

       

      library://ns.adobe.com/flex/spark"

      xmlns:mx="

      library://ns.adobe.com/flex/halo"

      xmlns:valueObjects="

      valueObjects.*"

      currentState="

      LogIn" xmlns:mx1="library://ns.adobe.com/flex/mx" xmlns:coupusersservice1="services.coupusersservice1.*">

       

      <s:layout>

       

       

       

      <s:BasicLayout/>

       

       

       

      </s:layout>

       

       

       

       

      <fx:Script>

      <![CDATA[

       

       

       

      import _model.MainModel;

       

       

      import mx.controls.Alert;

       

      import mx.events.FlexEvent;

       

      [

      Bindable] public var myEmail:String;

      [

      Bindable] public var myPW:String;

       

      ti_email.text = root.loaderInfo.parameters.myEmail;

      ti_password.text = root.loaderInfo.parameters.myPW;

      ......etc etc......

       

      <s:VGroup includeIn="LogIn" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10">
        <s:Label text="Email:"/>
        <s:TextInput id="ti_email" width="200" text=""/>
        <s:Label text="Password:"/>
        <s:TextInput id="ti_password" width="200" displayAsPassword="true" enter="logIn()" text=""/>
        <s:Button label="Log In" id="btn_login" click="logIn()" />

      </s:VGroup>

      .......etc etc.........

       

      And this is the html page with the passing of the flashvars:

       

      <param name='flashVars' value='myEmail=test1@test.com&myPW=test2>

       

      But right now i get an error on the lines with ti_email.text & ti_password.text. Here is that error:

       

      Description Resource Path Location Type
      1120: Access of undefined property root. LogIn.mxml NextBowl_swf/src/_view line 21 Flex Problem
      1120: Access of undefined property root. LogIn.mxml NextBowl_swf/src/_view line 22 Flex Problem
      1120: Access of undefined property ti_email. LogIn.mxml NextBowl_swf/src/_view line 21 Flex Problem
      1120: Access of undefined property ti_password. LogIn.mxml NextBowl_swf/src/_view line 22 Flex Problem

      Any help would be great to solve this problem of mine!

       

      David