difference in Flex 4.5 & flex 4.5.1, air 2.5 and air 2.7 - actionscript-3

import spark.components.supportClasses.MobileTextField;
in my Flash Builder 4.5 there is a error: it can't find the MobileTextField class in the park.components.supportClasses. i think it is in flex4.5 sdk and air 2.5.
so i want to know how to do it in flex4.5.1 sdk.

That was a beta class and it didn't make the cut.
http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/spark/components/supportClasses/MobileTextField.html
Although, you should be able to just use a TextField. Is there some specific functionality you were needing?

you can also use the property MobileTextField as
MobileTextField(txtMyText.textDisplay).htmlText = "sample <b>text</b>";
and it works. Just needed to import:
import spark.components.supportClasses.MobileTextField;
to get it working.

Related

NotImplementedError: pwmio not supported for this board

I am trying to control a servo using JetsonNano and a PCA9685 board. I am on Jetpack 4.3 and using python3. After a recent update I started to end up with the following error.
"NotImplementedError: pwmio not supported for this board"
from adafruit_servokit import ServoKit
kit=ServoKit(channels=16)
kit.servo[0].angle=90 ## Horizontal motion
kit.servo[1].angle=0 ## Vertical Motion
I've got the same issue at JetPack 4.6.
On JetPack 4.5.1 everything ok. I think something wrong with L4T 32.6.1...

Coding 4 fun library does not import Controller Class

I am trying to show toast message in foreground(while app is running).So i tried using Coding 4 fun library for this.But i can't seem to import controller class thus i am unable to create ToastPromt.I did install complete Coding 4 fun library with NuGet Package installer.
Btw I am making windows phone 8.0 project

Can't use import with package_as3

For some reason, when I use package_as3 in FlasCC I can't import any classes to use as a var.
package_as3
(
"#package private\n"
"import flash.system.MessageChannel;\n"
"var mc:MessageChannel;\n"
);
When I try to build anything that has this code in it, I get this:
Error: Type was not found or was not a compile-time constant: MessageChannel.
whenever I use the compiled SWC in Flex.
EDIT:
This doesn't just apply to flash.system.MessageChannel; it seems to happen to anything that gets imported.
A few things to try out
Syntax
I don't think you are supposed to wrap each line in quotes, nor add \n for string termination, so that's one thing that need mending.
SDK
The MessageChannel class requires SDK version 4.6 and above so did you select the correct SDK and add it to your buildpath?
Runtime
Also the MessageChannel interface did not get run-time support until version 14.0.0 (AIR or Player), so in project properties -> ActionScript Compiler, did you set the 'Require Flash Player Version' to version 14.0 or above?

JPEGEncoderOptions is undefined

I get a runtime error that JPEGEncoderOptions is an undefined variable when running the below code in AIR 3.5:
rawBitmapData.encode(rawBitmapData.rect, new JPEGEncoderOptions(), rawByteArray);
Make sure the following files in your sdk are up-to-date in the folder \yoursdk\frameworks\
air-config.xml
flex-config.xml
airmobile-config.xml
Update this:
<target-player>11.5</target-player>
<swf-version>18</swf-version>
This ensures your runtime is up-to-date
See : Use Adobe Air 3.3 SDK with Flash Builder
You may be missing an import of the flash.display.JPEGEncoderOptions package, or you may fully quality the package inline as below.
Example from Adobe Flash Platform Compressing bitmap data:
// Compress a BitmapData object as a JPEG file.
var bitmapData:BitmapData = new BitmapData(640,480,false,0x00FF00);
var byteArray:ByteArray = new ByteArray();
bitmapData.encode(new Rectangle(0,0,640,480), new flash.display.JPEGEncoderOptions(), byteArray);
If you get a runtime error, it can't be a missing import. You must be running it in a Flash Player that's too old, or an AIR runtime that's too old.
I've tested PNG encoding a while back and did this:
var bitmapData:BitmapData = yourBitmapDataHere;
if("encode" in bitmapData)
{
// use the native encode method
png = bitmapData.encode(bitmapData.rect, new PNGEncoderOptions(false));
}
else
{
// use old png encoder (from AS3CoreLib)
png = PNGEncoder.encode(bitmapData);
}
This effectively tests if your player or runtime environment supports BitmapData's .encode() method. If that test fails, you must be using a player that's too old.
Are you definitely including the class at the top of your code?
You need the latest Flex SDK to compile that, because those classes were only introduced in Flash Player 11.3. Flex SDK 4.6 worked for me, while Flex SDK 4.5 and lower gave me the same compiler error.
If its a runtime error, then you are running the content in a lower AIR version, or in a lower Flash Player version. Use the following method to fallback to normal code if the class is not present in the FP version you are running in. Useful for web content.
try {
// use FP 11.3 encoding
var options:Object = new JPEGEncoderOptions(quality);
var bytes:ByteArray = new ByteArray();
bitmap.encode(bitmap.rect, options, bytes);
} catch (e:Error){
// use manual JPEG encoding
}
It may be that you are missing a playerglobal for the version you are targeting or it's an incorrect playerglobal.swc in the SDK's player directory.
Download the latest Apache Flex SDK and switch to that if you can and try to create an instance of the class in a new project or your main application.
Honestly, I think it was a bug in the compiler or playerglobal. When I looked at the sdk folders I think that the playerglobal.swc might have been incorrect (all versions are named playerglobal.swc) OR it might have been the fact that I only had one directory in the SDK I was using and it had an "/11.2/playerglobal.swc" but no other folders. I think I would have needed a directory called "/11.5/playerglobal.swc" to have -swf-version make any difference.
It would be nice if the compiler threw an error when the playerglobal for the swf-version was not found at compile time. Go into the SDK folder and download and add the playerglobals to the SDK directory for the minimum targeted player to use this class.
In my Flex 4.6.0 SDK player directory, "$Flash Builder/sdks/4.6.0/frameworks/libs/player/" the swcs in:
11.1 dated 10/30/2012 351kb
11.2 dated 01/27/2013 352kb
11.5 dated 11/23/2014 351kb
11.6 dated 01/27/2013 352kb
15.0 dated 11/20/2014 388kb
In the Apache Flex 4.14RC install is:
11.1 dated 10/30/2012 351kb
11.2 dated 01/27/2013 352kb
11.5 dated 11/23/2014 351kb
11.6 dated 01/27/2013 352kb
15.0 dated 01/12/2015 388kb
It's possible something was installed somewhere along the way that is out of sync.

Flash 11.2 sdk definition of base class Sprite was not found

I'm trying to build a simple sample project using FlashDevelop using Flash 11.2. For some reason it wont let me extend Sprite. When I try to compile it just says:
col: 31 Error: The definition of base class Sprite was not found.
All I have in my code is:
public class Game extends Sprite
{
}
Make sure that you have the following setup in your Flex SDK installation correctly:
\frameworks\libs\player\11.2\playerglobal.swc
and that you have a compiler constant called "swf-version=15" set in FD.
If that doesn't solve it, you have an ambiguous path to your libs. May they have spaces or special characters in them.
Did you import the right package? flash.display.Sprite
You put starling-framework as a tag so if you're using Starling it should be:
import starling.display.Sprite;