简体   繁体   中英

Use Flex DateField component in Flash CS6

I'm trying to use the Flex DateField component in Flash CS6. I understand flex swc files which come packaged with Flash by default are not the full packages, so I downloaded the flex SDK.

I linked core.swc and mx.swc from the SDK in "Actionscript Settings" in my project. I can now refer to the DateField component, but when I try to add it to the stage, i get the following error:

1046: Type was not found or was not a compile-time constant: [mx.core]::IIMESupport
1046: Type was not found or was not a compile-time constant: [mx.managers]::IFocusManagerComponent

I'm adding it in the following way:

import mx.controls.DateField;
var df:DateField = new DateField();
addChild(df);

I need a date picker component which allows me to disable certain date ranges like before today and after a year and this appears to be the only component that will reliably allow me to do that.

I don't have access to FlashBuilder and FlashDevelop, only Flash Professional CS6. Any help will be appreciated!

It's not possible to use Flex components "as is" in Flash CS6 produced swf at least because the swf document class must be the flex Application .

Flex produced swfs (by mxmlc) also contains some additional logic like loading process with run-time-shared libraries loading and so. And flex is not only these two swc that you linked, if you check flex-config.xml you will find more that 10 different swc with some services, themes, utils and more.

But it should be possible to load flex swf inside CS6 swf with a Loader .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM