Adobe Air integrate Flex Componets

3

I'm developing a project through Adobe AIR and Action-Script 3, I found that UI Components does not support mobile, ie in Android or iOS they do not scroll-bar down and up with your finger .

As far as I can tell, it has the Flex Framework functionality. is it possible to integrate the Flex components for the current project that is in AIR? If so, how?

Technologies:

Adobe Flash Professional CC 2015 Adobe Flash Builder 4.7 Adobe AIR 18

    
asked by anonymous 22.11.2015 / 18:54

1 answer

0

You will not be able to use the Flex libraries in AIR AS3 because they have different SDKs and compilers . The Flex SDK is almost an extension of the AIR SDK, but not fully compatible as there are separate project and folder structures.

What you can do is convert your application. This process involves the migration of libraries, visual objects and folder structure, which makes it very difficult to do.

You can use some third-party component libraries or create your own components. The following code has a very basic example of scrolling :

import flash.display.MovieClip;
import flash.display.GradientType;
import flash.ui.MultitouchInputMode;
import flash.ui.Multitouch;
import flash.events.TouchEvent;
import flash.geom.Rectangle;

var mc:MovieClip = new MovieClip();
mc.graphics.beginFill(0xFF0000);
mc.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight * 2);
mc.graphics.endFill();
mc.graphics.beginFill(0x0000FF);
mc.graphics.drawCircle(stage.stageWidth/2, stage.stageHeight, 50);
mc.graphics.endFill();

this.addChild(mc);

Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

mc.addEventListener(TouchEvent.TOUCH_BEGIN, touchBegin);
mc.addEventListener(TouchEvent.TOUCH_END, touchEnd);

function touchBegin(e:TouchEvent):void {
    mc.startTouchDrag(e.touchPointID, false, new Rectangle(0, - stage.stageHeight, 0, stage.stageHeight * 2));
}

function touchEnd(e:TouchEvent):void {
    mc.stopTouchDrag(e.touchPointID);
}

There are other tutorials on the internet for you to scroll objects. A good library for you to enhance with smoothing effects is Greensock .

    
23.02.2018 / 18:11