Adobe Air integrate Flex Componets

Asked

Viewed 72 times

3

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

From what I understand, that has this functionality is the Flex Framework. is it possible to integrate the Flex components for the current project that is in AIR? If yes, how?

Technologies:

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

1 answer

1


You will not be able to use Flex libraries on AIR AS3 by having different Sdks and compilers. The Flex SDK is almost an extension of AIR SDK, but not fully compatible as there are distinct project folder and file structures.

What you can do is convert 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 increment with effects Smoothing is the Greensock.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.