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:

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 - 

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"; 
height="800" width="800"

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 

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