Adding a library into Flex 4 (flex iframe) - iframe

I am trying to use flex iframe with an Adobe Flex project in Flash Builder, and I've added the library through Project -> Properties -> Library Path -> Add SWC Folder but I am still getting the error The prefix "flexiframe" for element "flexiframe:IFrame" is not bound, as if I haven't linked it.
<flexiframe:IFrame id="googleIFrame"
label="Google"
source="htp://google.com"
width="80%"
height="80%"/>
I am extremely new to Flex, and I cannot find any good resources on it.

You are probably missing the namespace definition on top of your file:
<s:Application xmlns:fx=“http://ns.adobe.com/mxml/2009”
xmlns:s=“library://ns.adobe.com/flex/spark”
xmlns:mx=“library://ns.adobe.com/flex/mx”
xmlns:flexiframe="http://code.google.com/p/flex-iframe/">
[...]
</s:Application>
You can see this in the user's guide.

First download SWC folder from http://code.google.com/p/flex-iframe/downloads/list.
Then set this Project->Properties->Flex Build Path->Add SWC.
Link .swc from build folder. Include this also xmlns:flexiframe="http://code.google.com/p/flex-iframe/"

Related

Using mx components in an "actionscript project" in Flash Builder

In Flash builder, I want to create an "Actionscript Project" that uses the mx datagrid component. Unfortunately the mx/spark components don't seem to be available unless your project is a "flex project". Is there a way around this? (I really don't like using that mxml mark-up, and just want to write pure code)
thanks!
In ActionScript Build Path, you have to manually add SWC libraries outside Flex library as shown below (add additional libraries as per your requirement):

How to Open this file structure as Flex project?

I received a Flex project but don't know how to open it in Flash builder. It doesn't contain a project.mxml or .actionScriptProperties, .flexProperties and .project files.
the file structure looks like this:
(rootFolder)
-(com)
...subfoldrestructure containing only folders and .as files
-(src)
-(_embed)
-assets.fla
-assets.swf
-assets.swc
-Main-app.xml
-Main.as
-icon-16.png
...
-icon-128.png
how do I make a compilable Flex project out of this?
That is not a Flex project, that's a Flash project. Just create a new Actionscript project and point the location of it at the same location as this one. It will add the necessary project files to compile. It will try to create another Main actionscript file, but you can delete the one that it made and select the one already there as the default application.

How can I access data from a .fla file using Actionscript 3, Flex 4 SDK, and FlashDevelop?

Someone sent me a .fla file containing several art assets, with instances all configured to be displayed properly and in the right positions. However, since I'm using FlashDevelop with the Flex 4 SDK, I have no idea how to access these instances in code. Some of the objects are MovieClips that I need to modify the size of, and others are Dynamic Text objects that I need to change the display strings of at runtime.
If you have access to Flash (as in the development tool) you can right-click on a MovieClip in the library and select "Export SWC file".
The SWC file will contain all of the elements that have the "Export for ActionScript" property enabled. Place this SWC file on your classpath and FlashDevelop will tell the Flex SDK to link against it when building your final SWF.
If you don't have access to Flash to export the SWC you will need to get the other person to export the SWC file for you - you can't link against the FLA directly.
There's no obvious solution to this. basically, you will have to traverse the display list to find them, using numChildren, getChildAt etc. if you're lucky, they are named and you can use getChildByName.
greetz
back2dos

Converting a Flex custom component to a module

How to take an existing custom component in Flex and convert it into a module?
EDIT: What should be done in the mxml where this custom component is used? Should it be replaced with a to load the module? If yes, how to deal with code that uses instances of the components?
Change the root mxml tag to <mx:Module... then in the properties of the project click on the "Flex Modules" button and add it in there.
Edit: This is assuming your modules are in the same project. I prefer to create new projects per module as it makes development easier with multiple developers. So what I do is create a new project, change the root to <mx:Module..., in the properties of the module project I disable it from creating the html wrapper, then in my main project I just load up the module swf's based on what menu item was clicked
You would need to place a ModuleLoader in place of the custom component like
<mx:ModuleLoader id="moduleLoader" width="100%" height="100%"/>
And load the Module using the url.
moduleLoader.unloadModule();
moduleLoader.url = "path\to\module.swf";
moduleLoader.loadModule();
You can keep the above code in a function and load modules.
If your module will be used in the same project only, you can create a new MXML Module that can be optimized for the project from FlexBuilder

FlashDevelop - Why does code-completion not work with mx.controls

Today's my first day with Flex and FlashDevelop. In my ActionScript file, I have this line.
import flash.display.SimpleButton;
FlashDevelop is aware about this and Code-completion works fine.
But, when I have this line.
import mx.controls.Button;
Then code-completion doesn't work.
Works perfectly well for me w/o doing anything special. But maybe your project's properties got borked. Do this:
Open Project Properties
Go to Compiler Options tab
In Advanced -> Intrinsic Libraries add the following
Library\AS3\frameworks\Flex3
I had the same problem. Your AS3 class path is pointing at a directory to low in the flashdevelop library folder structure to pick the mx class prototypes.
1.) Within Flashdevelop press F10 to open the 'Settings' window.
2.) In the list on the left click on the 'AS3Context' option.
3.) Imediately Under the group title of 'Language' on the right hand side of the window, find the 'AS3 Classpath' option. Its value is typically set to 'Library\AS3\Intrinsic'. Change the the 'AS3 Classpath' value to read 'Library\AS3'.
4.) FIXED. Flashdevelop should now be aware of the mx libraries, thus autocomplete should now also work.
To include any swc to code complete, add it's parent folder to the swc libraries option. Some people claim that using intrinsic libraries works, but it didn't for me. Here's the paths to both settings:
ProjectSettings->CompilerOptions->SWCLibraries = {path to FOLDER containing swc's}
ProjectSettings->CompilerOptions->IntrinsicLibraries = {path to same FOLDER containing swc's}
It seems like you are missing the Flex framework in your build path. Have you looked at the libraries being included?

Resources