views:

1346

answers:

2

Hi Everyone, I just started using flashdevelop for flex apps (I had been using it for pure as3 projects previously). I can't figure out how to import files and such. I have included them to the library as usually. In this case I have included flexlib.swc and flexmdi.swc. Both are in my lib folder and both have been right clicked and Added to the Library.

Auto complete does not work so I think I am missing a step.

This is my code: `

<flexmdi:MDICanvas id="mdic" width="500" height="500">
 <flexmdi:MDIWindow id="win1" title="Window One" x="10" y="10">
  <samples:SampleContent />
 </flexmdi:MDIWindow>
 <flexmdi:MDIWindow id="win2" title="Window Two" x="250" y="250">
  <samples:SampleContent />
 </flexmdi:MDIWindow>
 <flexmdi:MDIWindow id="win3" title="Window Three" x="100" y="100">
  <samples:SampleContent />
 </flexmdi:MDIWindow>
</flexmdi:MDICanvas>

`

I also tried to add

<mx:Script>
     <![CDATA[
     import flexmdi.containers.MDICanvas;
     import flexmdi.containers.MDIWindow;
     ]]>
    </mx:Script>

I also get a strange error saying flexmdi:MDICanvas is not bound.

A: 

I might be way off here because we're talking about FlashDevelop, but I'm pretty sure you need to add the namespace for the MDICanvas in your MXML root tag, like this:

    <?xml version="1.0" encoding="utf-8"?>
    <MDICanvas xmlns="flexlib.mdi.containers.*" xmlns:mx="http://www.adobe.com/2006/mxml"    width="400" height="300">
       ...
    </MDICanvas>

The import statements only apply to .as files or <mx:Script> sections of your MXML code.

Death by repetition, but Flex has two ways to import classes and packages. The MXML way and the AS3 way.

Glenn
A: 

Unfortunately, the latest stable releases of FlashDevelop does not support code completion in MXML, although the feature is fully implemented in AS (you can browse packages in libraries with code completion in actionscript).

If you need help with MXML, I suggest keeping the library's API open side-by-side with FlashDevelop (it's what I prefer to do anyway). Still, you need to make sure that you include all of the XML namespaces. For example, for the Degrafa graphics library, you need to include

xmlns:gfx="http://www.degrafa.com/2007"

in the tag (there is also a similar namespace definition for the namespace "mx" already there).

However, MXML code completion is hopefully going to be implemented in a stable release very soon, and there have already been some ways to get it working.

Aethex