loadFilePromise() unavailable method in the class Loader using FB 4.7 (target iOS)

Here is my code:

errorLoadFilePromise.jpg

Note that mpLoader is declared as a class Loader, but when I try to use the loadFilePromise() method, it does not accept it syntactically.

Is there a reason for this?  I checked then triple in the online documentation. It comes to show me examples where loadFilePromise() works of course...

What's wrong with this code? Why won't it work?

I took this code directly from example ActionScript 3 on the Adobe website, but it did not work.

This is my new solution after 6 days of trial and error (error, for the most part)

public class TakePhoto extends Sprite
  {
       private var cameraUI:CameraUI = new CameraUI();
       private var cameraRoll:CameraRoll = new CameraRoll();
       private var dataSource:IDataInput;
       private var eventSource:IEventDispatcher;
       private var testTxt:TextField = new TextField();

       public function TakePhoto()
       {
            if( CameraUI.isSupported )
            {
                 testTxt.text = "CameraUI Initializing ...";

                 cameraUI.addEventListener( MediaEvent.COMPLETE, imageSelected );
                 cameraUI.addEventListener( Event.CANCEL, browseCanceled );
                 cameraUI.addEventListener( ErrorEvent.ERROR, mediaError );

                 cameraUI.launch( MediaType.IMAGE );
            }
            else
            {
                 testTxt.text = "CameraUI is not supported.";
            }
         }

         private function imageSelected(e:MediaEvent):void
            {
                 trace( "Media selected..." );
                 testTxt.text =  "Media selected...";

                 // Create a new imagePromise
                 var imagePromise:MediaPromise = e.data;

                 // Open our data source
                 dataSource = imagePromise.open();

                 if (imagePromise.isAsync )
                 {
                      trace("Asynchronous");
                      var eventSource:IEventDispatcher = dataSource as IEventDispatcher;
                      eventSource.addEventListener( Event.COMPLETE, onMediaLoaded );
                 }
                 else
                 {
                      trace("Synchronous");
                      readMediaData();
                 }
             }

            private function onMediaLoaded( event:Event ):void
            {
                 trace("Media load complete");
                 readMediaData();
            }

             private function readMediaData():void
             {
                 testTxt.text = "Read Media Data";
                 trace("Read Media Data");

                 var imageBytes:ByteArray = new ByteArray();
                 dataSource.readBytes(imageBytes);

                 var loader:Loader = new Loader();
                 loader.loadBytes(imageBytes);
                 loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageAddToCamRoll);
                 loader.contentLoaderInfo.addEventListener(ErrorEvent.ERROR, onMediaLoadError);

               }

            protected function imageAddToCamRoll(event:Event):void
            {
                 var loaderInfo:LoaderInfo = LoaderInfo(event.target);
                 var bmpData : BitmapData  = new BitmapData(loaderInfo.width, loaderInfo.height, false, 0xFFFFFF);
                 bmpData.draw(loaderInfo.loader);

                 try
                 {
                      cameraRoll.addBitmapData(bmpData);
                      trace( "image added to cameraRoll" );
                      testTxt.text = "Image added to cameraRoll";
                 }
                 catch (e:Error) {
                      trace( "Caught :: " + e );
                      testTxt.text = "Image failed to add to cameraRoll";
                 }
  }

It worked. Now I can take pictures and store them in the film.

Tags: Adobe AIR

Similar Questions

  • Why my game Center freezes when I go by parameters or directly by clicking on the center of games? Can I know which method is the best to use to solve this problem? Also, I use an iPhone 6 s, iOS 9.3.1

    Why my game Center freezes when I go by parameters or directly by clicking on the center of games? Can I know which method is the best to use to solve this problem? Also, I use an iPhone 6 s, iOS 9.3.1

    Have you ever tried to force reboot the phone by holding down the button sleep and home for 10 seconds, until the call logo comes back again?

    You won't lose data, but it can cure a few glitches.

    If this does not work, the initial Setup would be the next step:

    Use iTunes to restore your device to factory settings - Support Apple iOS

  • AppModuleImpl methods of the class returns the custom class types, not called.

    Hi all

    Methods of the class AppModuleImpl custom types of class, not called when you access through back links.

    OperationBinding operationBinding = bindings.getOperationBinding("getInstanceNameO"); where 'getInstanceNameO' is a method AppModuleImpl returns a class serializable type.

    Any help will be appreciated.

    OI_testBean.goInstanceName_methodCallNew (OI_testBean.Java:99): this line is the call of method appmoduleimpl: OperationBinding operationBinding = bindings.getOperationBinding("getInstanceNameO");

    Looks like 'bindings' is null.

    How to retrieve variable 'bindings '?

    Where is the OI_testBean.goInstanceName_methodCallNew () method called?

    If this method is called from the method call activity, you create pageDef in his name and add getInstanceNameO

    Dario

  • Method of the API to use to get the userlist provided to an object

    Hello

    What is the method of the API of the IOM to used to get the userlist which is provisoned for a particular object. ?

    Must, I'll input the name of the resource to say "DIO" and status of so-called resources ' set up ' and I want to get the users.

    can someone specify the method of the API to use.

    Thank you
    Naveen

    Use the following tcObjectOperationsIntf API method:

    getAssociatedUsers

    Thor.API.tcResultSet getAssociatedUsers (long objectKey,
    attributeMap java.util.Map)
    throws tcObjectNotFoundException,
    tcAPIException,
    tcAPIException

    This method is used to get the list of users who are associated with a specified object (implemented, off, on, etc.). If no filter is specified, it returns all the users who are associated with this object.

    Parameters:
    objectKey - this is the key of the resource object
    attributeList - a map of key-value pairs in which the result set should be filtered.

  • How to get the class Loader of Progress event

    I was charge test.swf file threw Loader class. How to get the class Loader of ProgressEvent, IOErrorEvent.

    function getLoader() {}
    var loader: Loader = new Loader();
    loader.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, progressHandler)
    loader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, ioErrorHandler);
    var request: URLRequest = new URLRequest ("test.swf");
    Loader.Load (request);
    }
    function progressHandler(event:ProgressEvent):void {}

    get the class loader
    }

    function ioErrorHandler(event:IOErrorEvent):void {}
    get the class loader
    }
    getLoader()

    the event target has a property of charger:

    Event.Target.Loader

  • How to limit the appeal of Web service method when the page loads?

    Hello

    I have an a choice selection list that is populated using a web service method. There are several different lists on the page. When a page loads, all of these methods of service web (methods are inside the POJO class) are executed.

    I would like to limit the call to the web service methods. The call occurs even if the component is not rendered. Basically, all methods in the page links are executed during the loading of the page. Is there a way to limit this behavior?

    More time is consumed during the loading of the page. Can someone help me on this?

    JDeveloper Version: 11.1.1.7.1

    Thank you
    Malenfant.

    You can play with the value of the condition of discount for links - see for example:

    https://blogs.Oracle.com/Shay/entry/delay_method_execution_when_us

  • Save the class file using XML

    Hi-

    I made a new class for LabVIEW, and I try to save a file using XML. Attached pictures show how to create the file and how I read it, and I get the error message. I tried a variety of different methods and nothing worked so far. I was wondering if anyone had any advice or examples to save a class to file via XML.

    In the meantime, I'll use the method described here:

    http://forums.NI.com/NI/board/message?board.ID=170&message.ID=215511&query.ID=672786#M215511

    but I would prefer XML for more usability later down the line.

    I also thought just not related to the group all the data structure, recording via XML and then just group it upward and writing to an instance of the class. This seems to be more work that needs to be necessary and should be redone every time I have change the class.

    Probably, it goes without saying that I am fairly new to LabVIEW so I hope this isn't a stupid error that is obvious to the vet...

    Thanks in advance,
    Nate

    First - Sorry for wany waste of time to download the wrong screenshot in the op.

    Second - I solved it! I was about to send a screenshot of my hierarchy for you to take a look at, but that made me think. I re-arranged my hierarchy; This solves the problem.

    Now, for all those who had the same problem (Error 1527):

    The first screenshot is my original project hierarchy, which did not work.

    The second is my hierarchy updated the project that solved the problem.

    Thanks for your help!

  • How the device a method in the class VOROWIMPL to insert a line?

    Mr President

    My worm jdev is 12 c (12.2.1)

    My use case, is that I want a method in my class vorowimpl to insert a row in my table.

    How to do this?

    Concerning

    OHK, have you checked the above shared link?

    You can use the same code in your class RowImpl and create a line like this

    ViewObject vo = this.getViewObject ();  To get ViewObject class RowImpl

    Line r = vo.createRow ();  To create the new line

    vo.insertRow (r); To insert newly created in the whole of lines


    Ashish

  • Method of the class

    Hello guys,.
    Hope it goes well...

    Please see the attached code...

    I added delivery and event onRelease on a movieClip and when I tried to use a movieClip (mainButton, circleButton) of this class he show undefined. I tried with Delegate.create. but no success... :(

    Please help me.

    Well, he left... (which extends the class MovieClip is a very persistent question).
    Extending the MovieClip class. This means that there should be a relationship between the class and a movieclip in the library (using the link identifier). You instantiate an instance either by putting an instance of movieclip on the stage, or by attaching an instance using the MovieClip.attachMovie ().
    You on the other hand create an empty movieclip, go to the class as a target. Essentially, you use composition instead of inheritance. I have attached the corrected code.
    Now, this method in your class:
    private void onReleaseEvent() {}
    var newM:Music = new Music()
    newM.showDetails)
    this.stopDrag ();
    }
    You create a new instance of the music "newM" with its own properties and methods (you create a NEW object), but you do not pass it a target mc... Thus the record coming with undefined. You must use the current instance here.

  • Create a button link URL in AS3 when outside the class is used.

    I need help!

    Quick background - I'm the guy at work who has the most basic understanding, base, base of Flash and was installed.  Makes me the guy ' go to ' now.  I've been avoiding AS3 for a few years now because I'm not a software engineer and my coding knowledge is quite limited. I have googled around for an hour and get something in AS2.  Not so much with AS3.  We have recently upgraded to Flash CC and had removed all previous versions, so now I have no choice.  I can follow directions but the technical jargon associated with AS3 is a learning curve steep for me when I do something like that, maybe twice a year.

    Now, what I'm trying to accomplish:

    It is simple stupid.  I have a flash web-banner.  The background is a static image of the PNG.  It has a countdown to a date.  I need the whole banner to function as a button so that when you click on it, it takes the user to a Web site.  That's all.  That's all I need.  I was able to do this in AS2 before without much of a fight.

    So I did the countdown using the script from this site:

    http://blog.anselmbradford.com/2009/08/03/creating-a-date-countdown-timer-in-ActionScript-3-Flash /.

    It works by referencing classes by external script.  It took me a bit of tinkering, but I got it together, no problem.
    So I'm going to make a button.  I create a button object.  Invisible, place it on a layer above all the rest.  I apply this code in action:

    MyButton.addEventListener (MouseEvent.CLICK, f);

    function f (e: Event) {}

    navigateToURL (new URLRequest ("http://www.adobe.com"));   Use the url of your choice.

    }

    And then it breaks.  The SWF up errors and will not compile.
    First of all, he says:
    1180: call to a method may be undefined, event.

    So I import flash.events.Event. Then, I get:
    1180: call to a method may be undefined navigateToURL.

    1180: call to a method maybe not defined URLRequest.

    1180: call to a method may be undefined addFrameScript.

    1120: access of undefined property MouseEvent.

    So I add:

    import flash.net.navigateToURL;

    import flash.net.URLRequest;

    import flash.events.MouseEvent;

    Who clears all errors except the 1180: addFrameScript.  What I've read, when there is an external class used, I can't apply action in a frame on the timeline script?
    It is so far above my head.  I tried for hours yesterday to find a way to add the script to the button to the main class, but the closest I had been set on my button never compile errors.  I don't know what I'm doing here and why it is so difficult to do two things at the same time in AS3.  I'm just frustrated with all this now.

    Could someone take pity on me and tell me what I need to do to get this working?  Try to use small words and talk to me like I'm the fool of the village, which is how I feel right now.

    Thank you!

    change this to the following and retest:

    Joshua Fowler wrote:

    I think you're right. Under the parameters of the publication, that's what 'Class' is pointing.

    This is the first main part of the code:

    package com.anselmbradford

    {

    import flash.display.MovieClip;

    import flash.events.TimerEvent;

    import flash.utils.Timer;

    SerializableAttribute public class Main extends MovieClip

    {

    /**

    Create a new object of Countdown, listen to updates and pass the date to countdown to.

    */

    public void Main()

    {

    var cd:CountDown = new CountDown();

    cd.addEventListener (CountDownEvent.UPDATE, _updateDisplay);

    CD.init (new Date (2015,3,9,20,00));

    }

    /**

    * Update the display.

    */

    private void _updateDisplay (evt:CountDownEvent): void

    Does this sound correct?

    Thanks again!

  • How can I control position to look for SWF files loaded by the class Loader?

    I created a grid of buttons that, when clicked, will load a specific swf and each swf, I would like to play in a certain part of the scene.  When to use the Loader class:

    var my_loader:Loader = new Loader();
    my_loader. Load (new URLRequest ("abc.swf"));
    addChild (my_loader);

    the swf file is always displayed at the top left. Is an attribute of the individual SWFS that I am loading, or can I address the position in the main sequence?

    Thank you-

    Sean

    ...

    addChild (my_loader);

    my_loader.x = 500;

    my_loader.y = 250;

  • Go to the second picture in the SWF loaded using Adobe AIR

    Hello

    I am a beginner to Adobe AIR. That I am charged an external SWF file in the AIR.

    But I can't go straight to the second image of this external SWF file of the AIR.

    How to load the second image of the external swf file. ?

    Thanks in advance.

    You must wait for function Event.COMPLETE the Loader to trigger to ensure that it is fully charged. After access the content of the loader property to access the MovieClip inside, for example:

    swfloader.addEventListener (Event.COMPLETE, onComplete);

    function onComplete(e:Event):void

    {

    var mc:MovieClip is MovieClip (e.target. content);.

    go to section 2

    mc.gotoAndPlay (2);

    }

  • ClassCastException in the custom class loader

    I created a custom class Leon.

    CCL ClassLoaderDemo = new ClassLoaderDemo(); assume that it works very well
    CLAS class = ccl.loadClass ('com '' ' MyObject');

    com MyObjectSuperClass o1 = (com. MyObjectSuperClass) clas.newInstance ();

    Now I want to get the object responsible for MyObjectSuperClass which is super class if MyObject. But I'm getting the following exception

    Exception in thread "main" java.lang.ClassCastException: com. Com cannot be cast to MyObject. MyObjectSuperClass

    Help, please.

    821458 wrote:
    My requirement is the class MyObject needs to be loaded by my client class loader. If you say that let the superclass (MyObjectSuperClass) be in the class path and let the class system charge charger, then usually it be a problem

    No, it's exactly what you want.

    MyObject loaded by the custom class loader, its super class loaded by the system class loader, I will be able to cast then.

    Yes, you will be able to cast to the upper class, then.

    It is not similar to the statement "MyObject loaded by the class loader and custom class system are different and we cannot throw.

    No, it isn't. your confusion is due to the fact that you don't seem to understand that you can have a class hierarchy that spans the Chargers of classes. This should be obvious because each object hierarchy extends eventually object, which is always in the system class loader. Therefore, you can always convert any instance of any class loader "Object". in the same way, you can have MyObjectClass in your chargers personalized classes and MyObjectSuperClass in the system class loader. You can instantiate an instance of MyObjectClass to aid reflection on your custom class loaders and assign it to a reference of the type MyObjectSuperClass. This is how pretty much any plugin system is implemented (the API is in the 'main' class loader and the implementation is in a nested class or custom ClassLoader).

  • get a .as class to use an external variable

    Hello

    I have an AS 2.0 class file that is associated with my FLA project. everything works very well. There is, however, a * hard-coded * IP address inside the class definition (.as file). I need to make a dynamic value (so that I can change the IP address during execution). I'm already loading and using the value dynamically (from a config.txt file) in a FLA file. but I don't know enough about the class definitions to be able to refer to this variable from the .as file (everything I tried was stupid and gave errors).

    So basically, how to reference the value of a dynamic variable charge of in a class definition?
    There is that something called dynamic classes in AS 2.0, the solution which means?

    any help appreciated, thanks!

    make a method in the class (.as) file to set the internal ip address.

    in the class file you would have something like

    var myURI:String = ""; Assign a default IP address

    function setURI(param_uri:String) {}
    myURI = param_uri;
    } //

    or you can put it inside the constructor of the class

    Constructor(param_uri:String)...

    where the manufacturer would be the name of the class
    that is the class name is FooBar
    the Builder would be
    FooBar(param_uri:String) {}
    myURI = param_uri;
    } / / end of constructor

  • instantiate the class SWF.

    Hey I'm after this link to create swf files .fla files, I will combine these sovereign wealth funds to create a SWF file, then I extracted my ipa who.

    Join several SWF files into a SWF for the deployment of the iOS | Adobe Developer Connection

    1. The first step is to build the SWF in Flash Professional or Flash Builder files, as you would normally, but make each SWF one class. Instead of loading a SWF dynamically via the class Loader, SWFLoader or a similar mechanism, you will instantiate the class SWF. Once meet you all SWFs, you'll be instantiate its content, does not it.

    This is the first step and I don't know how to a bond instantiate swf and main class can some one please guide me how to do this?

    It is wrong because it's out of date information.

    Use a loadercontext with the currentdomain load external swf and run their code.

Maybe you are looking for