How to use API exemples with Flash Pro ?

0 votes

Hi,

sorry to bother you with such a trivial question. I can't manage to make the simpliest exemple work with AS3.

In a very simple project folder with a test.fla, test.as (wich is declared as the document class) : 

  1. what script inside test.as ?
  2. where to copy App42_ActionScript_SDK_Web_2.7.swc ? In a "com" subfolder ?
  3. where (wich .As) to write "Import Statement", "Initialize", "Build Service", "Create Albums" (for example)

thank you to put me on track.

asked Apr 20, 2015 in App42 Cloud API-BaaS by starcmd (29 points)

1 Answer

0 votes

Hello Starc,

Thanks for writing to us. Kindly have a look at  below links to get started with App42 AS3 SDK and let me know if it helps:

 Note: Gallery, Upload and Gift service is only available for mobile application and it have separate swc file to integrate. You can find the septate swc file in version folder with the name App42_ActionScript_SDK_Mobile_2.7.swc. Please check and let me know if you required any help from our  side. 

Thanks,

Himanshu Sharma

answered Apr 21, 2015 by hs00105 (2,005 points)
Hello, I did read all your examples, a lot, and tried hard before posting that questions :-/ These OOC concepts escape me ...

Flash generate many compile errors.
I tried to correct them line by line : below the code write in one "test.as" file declared as the "test.fla" document class that finally work ...

It does not match exactly your example : Why ?
 
1 - I need to "import" inside the package ; also outside. Is it correct.
2 - I "created" an "import com.shephertz.app42.paas.sdk.as3.App42CallBack" that is not présent in your API doc. Otherwise I always got an error : "unable to find App42CallBack interface"

This code work, but i guess it is not the way i should write it ....

I know it's more an AS3 knowledge problem than an app42.
Everywhere I found either truncated examples or far more complicated exemples...

Thanks again to support me.
Stacmd
--------------------------------------------------------------------------


package {

    import flash.display.Sprite;

    import com.shephertz.app42.paas.sdk.as3.App42API;
    import com.shephertz.app42.paas.sdk.as3.App42Response;
    import com.shephertz.app42.paas.sdk.as3.App42BadParameterException;
    import com.shephertz.app42.paas.sdk.as3.App42NotFoundException;

    import com.shephertz.app42.paas.sdk.as3.user.Profile;
    import com.shephertz.app42.paas.sdk.as3.user.UserGender;
    import com.shephertz.app42.paas.sdk.as3.user.User;
    import com.shephertz.app42.paas.sdk.as3.user.UserService;


    public class createUser extends Sprite {

        public function createUser() {

            var userName: String = "User1";
            var pwd: String = "User1";
            var emailId: String = "user1@internet.com";

            App42API.initialize("........", ".........");

            var userService: UserService = App42API.buildUserService();
            userService.createUser(userName, pwd, emailId, new callback());
            trace("TEST !!!!");
        }
    }

}

import com.shephertz.app42.paas.sdk.as3.App42Exception;
import com.shephertz.app42.paas.sdk.as3.App42CallBack;
import com.shephertz.app42.paas.sdk.as3.user.User;

class callback implements App42CallBack {
    public function onSuccess(response: Object): void {
        var user: User = User(response);
        trace("userName is " + user.getUserName());
        trace("emailId is " + user.getEmail());
    }
    public function onException(exception: App42Exception): void {
        trace("Exception Message " + exception);
    }
}
Hello,

Thanks for your input, will definitely update our documentation with import statement. About the statement "this service is very useful for developers who want to integrate Photo Gallery functionality to their Mobile/Device and Web Apps" is a common statement for all platforms which we supported. For AS3, we have mentioned in the project readme that Upload API  is only supported on Mobile/Desktop apps which you can find from the below link:

https://github.com/shephertz/App42-ActionScript-SDK/
 
Let me know if it helps.

Thanks,
Himanshu Sharma
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...