mardi 25 avril 2017

Adobe AIR call SoftKeyboardType Phone IOS

is it possible to call phone (not number but phone) keyboard from adobe air on ipa IOS? or is there any ANE?

enter image description here

How to load a SharedObject from another Swf file in actionScript 3.0

This code works, but when I put the loadBtn and the function 'loadNames' in another swf file, the program traces this: "saved names: undefined", in addition I'd like to specify the path of the object saved:how can i do that?

var SO:SharedObject=SharedObject.getLocal("mySave");

var archive:Array=new Array(); var counter:Number=-1;

saveBtn.addEventListener(MouseEvent.CLICK, saveName); loadBtn.addEventListener(MouseEvent.CLICK, loadNames);

function saveName(event:Event) {

counter++;

archive[counter]=input.text;

SO.data.arrSaved=archive;

SO.flush();

}

function loadNames(event:Event) {

trace("saved names: "+SO.data.arrSaved);

}

How do I overwrite a delay in TweenMax?

I am working in actionscript 3 using a Greensock TweenMax timeline. I have a one page scroller with two buttons (back to the top, and stop/play button). The scroller automatically plays onLoad with a delay of 4 seconds. When I press stop/play button, it doesn't stop the delay. I have to wait the full four seconds before it functions. Also the 4 second delay only happens when the scroller runs for the first time. How can I get the 4 second delay to happen everytime the scroller repeats? How can I get the stop/play button to override the delay and play? I have worked on this for two days, and tried various techniques (for loops, timers, delayed calls, etc.) with no success. If anyone has ideas I will greatly appreciate it.

1) Code that starts the timeline:

myTween = new TweenMax(content_mc, 60, {delay:4, y:22, ease: Power0.easeNone, onComplete: restartFromTop });

2) This function controls the stop/play button

    private function toggler(e:MouseEvent = null):void 
    {           

           if (playState == true){  
           toggleBtn.gotoAndStop(2);
           myTween.pause();
           playState = false;
           trace("MC is now paused and stopped");
        }

           else if(playState == false) {
           myTween.resume();
           toggleBtn.gotoAndStop(1);
           playState = true;
           trace("MC is resumed from pause");  
        }
    }

3) This function controls the restarting of the scroller when it repeats.

private function restartFromTop():void 
        {       
            myTween.restart()
            playState = true;
        }

4) This function controls the back to the top button

private function backToTop(event:MouseEvent):void 
        {
            myTween.reverse();

            if (playState == true){
                myTween.restart();
                myTween.resume();//stop animation
                //toggleBtn.gotoAndStop(2);//changes button to pause
                toggleBtn.buttonMode = true;
                trace("page is scrolling");
            }

            if (playState == false){
                myTween.restart();
                myTween.pause();//stop animation
                trace("play button is paused");
                trace(timer);
            }

//Adds a hand cursor on the button and adds a click event to the button. 
            toggleBtn.buttonMode = true;
            toggleBtn.addEventListener(MouseEvent.CLICK, toggler);
        }

actionscript 3 when i click on object to go to another scene

I am designing a simple drag and drop dressing game I have two classes first on is DragDrop class that I assigned for dressing objects and back class that I assigned for back button that return me to main scene.

The problem that when I start drag object and drop it and press back button I get an error saying :

"TypeError: Error #1009: Cannot access a property or method of a null object reference.

and the objects that I dragged and dropped move to the main scene at

Dressing_fla::MainTimeline/frame1()[Dressing_fla.MainTimeline::frame1:61]
at flash.display::MovieClip/gotoAndPlay()
at Dressing_fla::MainTimeline/fl_ClickToGoToScene_12()[Dressing_fla.MainTimeline::frame2:15]"

I don't know what is the problem

DragDrop class:

package  {
        import flash.display.*;
        import flash.events.*;
        public class DragDrop extends Sprite {

        public function DragDrop() {
                this.addEventListener(MouseEvent.MOUSE_DOWN,drag);
        }

        function drag(evt:MouseEvent):void{
            stage.addEventListener(MouseEvent.MOUSE_UP,drop);               
            this.startDrag();
            parent.addChild(this);


        }

        function drop(evt:MouseEvent):void{

            this.stopDrag();
            stage.removeEventListener(MouseEvent.MOUSE_UP,drop);

        }           
      }

  }

Back class:

package  {
import flash.display.*;
import flash.events.*;  
public class Back extends Sprite  {

    public function Back() {
        this.addEventListener(MouseEvent.CLICK,clicked);
    }

    function clicked(evt:MouseEvent):void{


        MovieClip(this.root).gotoAndPlay(1, "main");

       }



    }

 }

the game is here

Import flash.net.SecureSocket throwing error "Definition XXX could not be found"

My requirement is to make connection using SSL and TLS from my flexbuilder AS code. I google it and found that SecureSocket() will be used to communicate with SSL and TLS from the below url,

http://ift.tt/1QulXAn

While trying to implement the same in my code, I am not able to import the namespace SecureSocket (import flash.net.SecureSocket;) and while referring it throws the error as "Definition flash.net.SecureSocket could not be found"

FYI - I'm using Flex Builder version 3

Please advice

lundi 24 avril 2017

How to stop a movable object (which moves via the arrow keys) from going off the stage in Adobe Flash Professional CS6 Action Script 3.0

Hey I'm currently creating a game in Adobe Flash Professional CS6. I have a character, with an instance name of "alien". So far, I've only been able to code my game so that the alien can't go off the top or left sides of the stage. I can't figure out how to code it so that the alien can't go off the bottom or right sides of the stage. The coding I have is as follows:

if((alien.x) < (alien.width/2)){
      alien.x += 10;
}
if((alien.y) < (alien.width/2)){
      alien.y += 10;
}

Thank you for your time.

how to save different arrays in a DB and load them

In few words, I'm building an application divided in two parts: in the first part, I can create an array of display Objects and it should be saved somewhere, for example in a database. In the second I've the possibility to load all the arrays saved in the database and to see them. I'm searching a solution to store the arrays, firstly giving them an Id, and second storing them on a server, or in local if it seems to much complicated. I've thought to use the class shared Object, but i don't know perfectly how it works. I've also tried without success to save the array, but i really don't know how to use this class, thanks