Thanks, Srinivas. It's true, I came to Flash Builder in a bit of a hurry and didn't take the time to read as much of the documentation as I should have. I had indeed not understood the FB mechanisms properly. With your explanation I understand a bit better what I need to do. Thanks again!

On 01/30/2012 10:38 PM, Srinivas Sandur Madhu Murthy wrote:

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 <mailto:d...@streemit.net>>
*To:* flexcoders@yahoogroups.com <mailto: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 <http://flash.net.na/>.navigateToURL;
import flash.net <http://flash.net.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