AS3 Libraries: Am I missing FileStream? - actionscript-3

I think I'm missing some classes in my library.
If I type in 'import fil', FD4 autocompletes to only this:
import flash.net.FileFilter
import flash.net.FileReference
import flash.net.FileReferenceList
I saw people using FileStream and wondered why I don't have this class available.
Do you guys know why this happens and how I can obtain the library?

FileStream is only available when targeting AIR 1.0+.

Related

import interface built outside of flash

Trying to learn from a game on github which is backgammon and the fla stage is empty with class files external so when you test the swf it cannot find the interface that is attempting to load :
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.text.TextField;
import flash.text.TextFormat;
import multiflame.game.IGame;
import multiflame.game.IContainer;
import multiflame.game.Constants;
Would the interface be something created in flash builder which I use along with flash CS6 or could those AS3 files be just as easily created in flash? I am new to flash builder and trying to figure out if it is used primarily for networking builds in which case the interface would be best executed there or doesn't it matter?
For very basic explanation - in your case interfaces are very similar to classes - external files with code in it. They are nothing special created with different programs - they are just plain text files named .as
You should provide the error you're getting, but if it says that the interface cannot be loaded, it means that Flash cannot find the file. In your case, if the interface error is about IGame, it means that in your folder where the .swf file is, you must have subfolder multiflame with game folder inside it, and a IGame.as file there.
This is of course if you don't know how to manage source paths - there's a property inside Flash AS options which you can set to target specific directory (for example D:\ can be mapped as root of your classes and so multiflame directory should be inside D:\, no matter where your swf is).
p.s.
Further you can read about interfaces and what they do: http://code.tutsplus.com/tutorials/as3-101-oop-introduction-to-interfaces--active-8199
I haven't read the whole tutorial but it seems large enough to cover the idea.

MXMLC compiler missing filesystem library

I've had not trouble until this point directly from MXMLC command line. While compiling Actionscript 3 code I ran into a dependency problem.
import flash.filesystem;
and I get
Error: Definition flash:filesystem could not be found
There are another or two file-related libraries such as filestream. Where can I find these standard libraries and how might I add them to my MXMLC library PATH?
What are the specific classes you are trying to use? If you want to import all of the classes in the flash.filesystem package you need a * at the end of that import statement. Otherwise you need to append the class name(s). Something like one of these:
import flash.filesystem.*;
or
import flash.filesystem.File;
The other thing that might be an issue is the values in your flex-config.XML (or air-config.xml) file that is part of the SDK. You might need to configure this to include the classes in the AIR sdk, etc.

Can't import qnx.fuse

I'm creating a BlackBerry app for PlayBook using Adobe Flash Builder. For that I need to import qnx.fuse.* and it shows an error message telling The import fuse could not be found. But I can import some other BlackBerry components. For example, I have the following imports:
import qnx.dialog.DialogButtonProperty;
import qnx.dialog.PromptDialog;
import qnx.display.IowWindow;
import qnx.fuse.ui.buttons.LabelButton;
import qnx.fuse.ui.text.Label;
But, only the last two imports show errors. Why is that?
Thanks in advance!
The new Fuse components are the correct ones to use for AIR development at Playbook.
The API is documented at https://bdsc.webapps.blackberry.com/air/api
Maybe you can't import qnx.fuse.*; because there are no classes in that folder, it just holds other sub-folders. It's ok.
What Blackberry Playbook sdk version for air you have installed.
import qnx.fuse.ui.buttons.LabelButton;
import qnx.fuse.ui.text.Label;
These imports can be used if you are using Flashbuilder 4.6 & Air version 3.1 , below it will not supported.
https://developer.blackberry.com/air/apis/
You need to do two things to get access to those classes.
Add the native extension QNXSkins from qnx
Add the quxui.swf to your Library Path (Properties->Build Path->Library path). That file is located at /Application/ResearchInMotion/blackberry-tablet-sdk-3.1.0/frameworks/libs/qnx (on Mac).

Using "Import" AS3

I´d like to know.
What exactly does 'import'?
I´m thinking about to use a flash component with this 'import':
//import the required data class
import fl.data.DataProvider;
//import the AutoComplete class
import com.yahoo.astra.fl.controls.AutoComplete;
I mean, I don´t have those folders in my app main folder.
Is it importing from web?
If yes, is it safe? If server is shut down, will the app, that uses those classes, crash?
Thanks.
I am almost completely certain that import does not get anything from the web. I use imports for a complex game core I wrote. Imports can either import from a component of the Flash platform, or from your own classes. When the .swf is compiled, those classes are pulled in and compiled as part of the project.
In order to import something other than from the Flash platform, you WILL need to have the folders in your project. For example, I have gradua.as at trailcrest/gradua/gradua.as, and that trailcrest folder is located in the same directory as my Flash project (.fla). At the top of my gradua.as class, I have the following:
package trailcrest.gradua
{
public class gradua
Then, I can import gradua for use in my main .fla's document class (named osr.as, btw)...
import trailcrest.gradua.gradua;
public static var Gradua:gradua = new gradua();
And I can access its functions (such as my Score function) from anywhere in my project...
osr.Gradua.Score(true);
Again, to restate...to the best of my knowledge, you CANNOT import from the web this way. Flash is going to look for the file path com/yahoo/astra/fl/controls/AutoComplete.as in your project directory...and in a couple other places on your computer, tho I'm not sure where atm...
With the import statement you can include certain ActionScript classes in your application, which then will be compiled in your SWF file. If you use strict syntax and you try to use a Class member that is not imported, the compiler will tell you about it. Otherwise your app will still work.
The imported AS classes must be added to your library path, or src path when working on an ActionScript project. You can't import online files.
Rob

importing weka in java after installing weka

i stalled weka in my system but still im having problem to use weka classes in my java code?
im using netbean its show me class file not available when i try to import my weka class?
http://wiki.forum.nokia.com/index.php/Adding_a_new_library_to_NetBeans ?
The package view of a weka test project :
1) Adding weka.jar into your Java project classpath.
2) Importing the class you want to load like this import weka.XXX.XXX;.
Make sure the above two simple steps is done. Any question :)