Srinivas, don't say other to do WHAT if they are following the basic Netiquette?
These are the following reason why you can't give tongue to community member:
1. You are not authorized as I think you are not the admin of the group.
2. I am not getting paid to deliver the solution.
3. This is a free forum and you are free to post solution or your opinion.
4. I love to debug the code and specify the exact solution if I am aware of.

Dan, 
To be more specfic, please refer to the attach IntegratedEncoder.FXP project 
where I have merged your controller logic into a single MXML file as the basic 
rule to create a flex application is to have only one Applicatin container as 
root.

About the Application container
The first tag in an MXML application is either the <s:Application> tag for the 
Spark application container, or the <mx:Application>
tag for an MX application container. The application container then becomes the 
default container for any content that you add to your application.

In IntegratedEncoder.mxml, the <s:Application> is the root tag, whereas 
IntegratedEncoderController.as is extending the <mx: Application>.

Regards,
Rishi Tandon


________________________________
 From: Srinivas Sandur Madhu Murthy <s.m.srini...@gmail.com>
To: flexcoders@yahoogroups.com 
Sent: Tuesday, January 31, 2012 10:08 AM
Subject: Re: [flexcoders] Moving my command-line development to FlashBuilder4.6 
- confused.
 

  
Rishi,

Please read the complete email before you ask for something. I understand you 
like to help, but please read-up completely, understand problem & then ask for 
things to help more.

Dan,

Whether you use Command-line or Flex Builder it doesn't matter, you always will 
try to compile 1 application in entire project, unless you have two or more 
applications in the project. Correct me if I am wrong, as my understanding goes 
you have EncoderController.as file which has class definition for 
"EncoderController" class which extends I guess from Application/Sprite. I 
guess this is the reason your project's main mxml file has root node as 
<local:EncoderController...../>. Now if you are using Flex Builder, normally 
the main application mxml file which Flex Builder Template creates has root 
node as s:Application. In your case, after that mxml is created all you need to 
do just replace that default auto generated code by your old mxml contents & 
include EncoderController.as in the src directory, which should work fine for 
you.

FX:Script tag is used in mxml to just include AS scripts which doesn't have 
class definitions. Normally these AS files would have methods, variables etc 
required or used in MXML file. I hope you know that any MXML file can use 
fx:script tag and write the AS scripts stuff required in that particular MXML. 
Treat this MXML+AS script as class.

The reason why you getting error in first place is, the MXML file which you 
have is extending from spark::Application [hence root tag as s:Application] & 
included AS file has definition of a class which also extends from 
spark:Application.

Writing code and compiling with SDK using compile time shouldn't be different 
from using Flex Builder. In-fact it gives more flexibility & user friendliness. 
Please read-up more on using Flex Builder, should help you convert your 
application more easily.

Let me know if you need more help.

Thanks
Srinivas

On Jan 30, 2012, at 4:11 AM, Tandon, Rishi wrote:

  
>
>
>Dan, send over your mxml and as file here.
>There could be many reasons for the exception:
>1. Compatible with the sdk. Try to change to flex sdk 3.2 or 3.6
>2. Namespace inclusion.
>In you code, the namespace is pointed to "http://www.adobe.com/2006/mxml";
>Whereas, in sdk 4 onwards, we are using three namespace:
> xmlns:fx="http://ns.adobe.com/mxml/2009";
> xmlns:s="library://ns.adobe.com/flex/spark"
> xmlns:mx="library://ns.adobe.com/flex/mx" 
>
>
>
>
>
>
>Regards,
>Rishi Tandon
>
>
>
>
>
>________________________________
> From: Dan M <d...@streemit.net>
>To: flexcoders@yahoogroups.com 
>Sent: Saturday, January 28, 2012 12:54 AM
>Subject: [flexcoders] Moving my command-line development to FlashBuilder4.6 - 
>confused.
> 
>
>  
>I downloaded and installed the Mac version of Flash Builder 4.6. There 
>is enough development work yet to be done on my project I figured that 
>having an IDE to work in might make life easier.
>
>The project was originally written as an mxml file (Encoder.mxml) and an 
>ActionScript file (EncoderController.as). The mxml file refers to the 
>ActionScript file by starting out with :
><local:EncoderController xmlns:mx="http://www.adobe.com/2006/mxml"; 
>layout="absolute"
>xmlns:local="*"
>height="800" width="800"
>backgroundColor="#FFFFFF"
>backgroundAlpha="0">
>
>On the Mac I selected "New" then "Flex Project" and named the project 
>"IntegratedEncoder". That got me an mxml file. I then copied the .as 
>file over from my other working environment, renamed it 
>"IntegratedEncoderController.as", changed the class name appropriately, 
>and modified the new mxml file Flash Builder made for me to include 
>"<fx:Script source="IntegratedEncoderController.as" />"
>
>When I save the file the editor windows for 
>IntegratedEncoderController.as shows an error on the line in which I 
>import flash.media.Camera. The line with the error and the lines 
>surrounding it are:
>
>import flash.display.*;
>import flash.events.MouseEvent;
>import flash.events.NetStatusEvent;
>import flash.external.ExternalInterface;
>-->import flash.media.Camera; <---
>import flash.media.Microphone;
>import flash.media.Video;
>import flash.net.navigateToURL;
>import flash.net.NetConnection;
>
>The indicate line is the one with the error messages. The error messages 
>associated with it are:
>1084: Syntax error: expecting identifier before leftbrace
>1131: Classes must not be nested
>
>I also get an error indicated in when I declare a variable of type Camera:
>private var camera:Camera;
>The error message associated with this line is another occurence of
>1131: Classes must not be nested
>
>I've also got some other error messages, indicated in the editor with 
>yellow question marks. In the constructor for the class:
>public function EncoderController()
>{
>--->        addEventListener(FlexEvent.APPLICATION_COMPLETE,mainInit); <---
>}
>the indicated line is marked with "Call to a possibly undefined method 
>addEventListener".
>
>In the mainInit method, I then have two lines:
>stage.align = "TL";
>stage.scaleMode = "noScale";
>both marked with Access of undefined property stage
>
>The code I copied over from my other machine compiles just fine using 
>the SDK and it runs fine. Why is Flash Builder giving these errors? It 
>looks like it is having problems importing flash.media.Camera and 
>appears confused by addEventListener. Have I done something with my 
>project setup that is screwing with Flash Builder? I'm thinking I'd like 
>to be able to do the rest of this project development in FB, but this 
>isn't looking very promising so far.
>
>
>
>
>
>

 

Reply via email to