Audio-> "complete" event vs SoundChannel-> 'soundComplete' event

Hello

Here can someone explain the difference practice between:

event full of sound class event and soundComplete of class SoundChannel ?

What are the exact differences between the two? When exactly the two events are dispatched? They are still together or not - which is the first?

The documentation is very terse in this case (as usual for most...).

Thanks in advance!

Sound class

This is not a complete event (in the way one might think). What you might be referring to (in the Docs of the ACE) is using the flash.events.Event.COMPLETE event. This is only used for loading the audio files and tells you when the data has been loaded successfully. Thus, as a general rule, you just use the Sound class to manage the loading of things...

SoundChannel class: flash.events.Event.SOUND_COMPLETE

This is what should be used to detect the completion of the audio. The SoundChannel class is what you want to use to control the stop/pause/play of things.

private var _s:Sound;

private var _sc:SoundChannel;

Loading audio...

_s = new Sound();

_sc = new SoundChannel();

_s.addEventListener (IOErrorEvent.IO_ERROR, errorHandler);

_s.load (new URLRequest (url));

During audio playback...

_sc = _s.play ();

_sc.addEventListener (Event.SOUND_COMPLETE, soundCompleteHandler);

Tags: Adobe Animate

Similar Questions

  • Won't COMPLETE event triggers of level FEIELD, even if the user clicks ABOUT on the field in question?

    Hello

    Pls can someone answer my question pls its here is the link

    http://forums.Adobe.com/message/4549663

    Q just quick who:

    Won't COMPLETE event triggers of level FEIELD, even if the user clicks ABOUT on the field in question?

    Thank you

    Hello

    Here is an explanation of the output events of the specification XFA (page 391).

    get in, get out

    Enter the event fires when the field gets keyboard focus, that it was caused by a user action

    (in the field of the tab or by clicking with the mouse) or by a script by setting programmatically the

    Update. It is also raised when a new selection is made from a list of choices, but this behavior can be prevented.

    See below.

    The exit event is triggered when the field loses keyboard focus. It has also triggered whenever there is a new selection

    in a list of choices (followed by an input event), but this behavior can be inhitibited.

    I hope this helps.

  • FileReferenceList does not return a complete event

    Hello people of Forum!

    I have an application that downloads the files. A moment with FileReference file download works. No problems. But when I try to use FileReferenceList, objects in the FileReferenceList FileReference table do not return an Event.COMPLETE, when they finished. Both versions violate the same servlet, so I start from the principle that there should not be no problem on the receiving end. When I throw in debugging code, I see the return of open FileReferenceList object and progress events, but never a full event. Here is what my code does:

    The user clicks on the 'Browse' button and selects the files. When they're done, the button is clicked "Upload" and they clicked. I make a few calls to a database to retrieve identifiers of document and then I go through the download process:

    var fileReference:FileReference = FileReference (this.uploadFileArray.pop ());
    fileReference.addEventListener (Event.OPEN, traceEvent);
    fileReference.addEventListener (Event.COMPLETE, completeEvent);
    fileReference.addEventListener (IOErrorEvent.IO_ERROR, traceEvent);
    fileReference.addEventListener (ProgressEvent.PROGRESS, progressEvent);
    fileReference.addEventListener (SecurityErrorEvent.SECURITY_ERROR, traceEvent);
    var req:URLRequest = new URLRequest (endpoint + paramString);
    Req.Method = URLRequestMethod.POST;
    fileReference.upload (req, "whatever", false);
    progressBar.label = "Loading"... » ;
    btnCancelFile.enabled = true;

    Here is my 'complete' event handler:

    private void completeEvent(event:Event):void {}
    mx.controls.Alert.show ("completed event.");
    traceEvent (event);
    }


    I'm pretty much after the code of the language reference. The complete event is blocked or am I completely missed something obvious?

    I'll take suggestions or advice! Thanks in advance for the help!

    -Andy

    It seems that unless you keep a handle on the FileReference, flash will clean memory engine object it real quick. Which is what is happening here - even if the files were sent to the servlet without problem, the garbage collector has been sucking the FileReference objects until they could send the complete event.

    So the solution here was to place the FileReference object in a table just before download command and then remove it from the table when the end event is raised, so that garbage collection can collect timely.

    It was in fact in the documentation somewhere, but for some reason it didn't register only.

    Anyhoo... He is a good example of what to do about the specifications of lang in the FileReferenceList page under examples.
    http://livedocs.Macromedia.com/Flex/2/langref/index.html

    Hope this helps... someone. :-)
    -Andy

  • CameraUI on COMPLETE event does not not on my phone

    I have this weird problem using adobe air. I tried to study the cameraui and tested on my phone.

    The question is when I start to capture the image, the image have not saved in the gallery. He also wasn't up to the line of the "trace ('Media captured...". ») ; ».

    I wonder because when I tested it on the other device, it works perfectly.

    I hope you could help guys. Thank you very much.

    This is the code I used.

    package com.movent

    {

    import flash.desktop.NativeApplication;

    import flash.display.BitmapData;

    import flash.display.Loader;

    import flash.display.LoaderInfo;

    import flash.display.Sprite;

    import flash.display.StageAlign;

    import flash.display.StageScaleMode;

    import flash.events.ErrorEvent;

    import flash.events.Event;

    import flash.events.IOErrorEvent;

    import flash.events.MediaEvent;

    import flash.events.MouseEvent;

    import flash.filesystem.File;

    import flash.media.Camera;

    import flash.media.CameraRoll;

    import flash.media.CameraUI;

    import flash.media.MediaPromise;

    import flash.media.MediaType;

    import flash.media.Video;

    SerializableAttribute public class Main extends Sprite

    {

    private var deviceCameraApp:CameraUI = new CameraUI();

    private var imageLoader:Loader;

    public void Main()

    {

    This.stage.Align = StageAlign.TOP_LEFT;

    this.stage.scaleMode = StageScaleMode.NO_SCALE;

    If (CameraUI.isSupported)

    {

    trace ("Initializing camera... ») ;

    deviceCameraApp.addEventListener (MediaEvent.COMPLETE, imageCaptured);

    deviceCameraApp.addEventListener (Event.CANCEL, captureCanceled);

    deviceCameraApp.addEventListener (ErrorEvent.ERROR, cameraError);

    deviceCameraApp.launch (MediaType.IMAGE);

    }

    on the other

    {

    trace ("Camera interface is not supported.");

    }

    }

    private function imageCaptured (event: MediaEvent): void

    {

    trace ("Media captured... ») ;

    var imagePromise:MediaPromise = event.data;

    If (imagePromise.isAsync)

    {

    trace ("media asynchronous promise.");

    imageLoader = new Loader();

    imageLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, asyncImageLoaded);

    imageLoader.addEventListener (IOErrorEvent.IO_ERROR, cameraError);

    imageLoader.loadFilePromise (imagePromise);

    }

    on the other

    {

    trace ("media synchronous promise.");

    imageLoader.loadFilePromise (imagePromise);

    showMedia (imageLoader);

    }

    }

    private function captureCanceled (event: Event): void

    {

    trace ("Media capture canceled.");

    NativeApplication.nativeApplication.exit ();

    }

    private function asyncImageLoaded (event: Event): void

    {

    trace ("Media loaded in the memory.");

    showMedia (imageLoader);

    }

    private void showMedia (loader: Loader): void

    {

    this.addChild (charger);

    }

    private void cameraError (error: ErrorEvent): void

    {

    trace ("Error:" + error.text);

    NativeApplication.nativeApplication.exit ();

    }

    }

    }

    I got it already. I just master reset my phone.

  • Leave the Mobile Application on the Timer complete event

    Hello

    Why is - it does not work on an Android device, but on the desktop?

    private void onDeactivate(event:Event):void
    {
    applicationExitTimer = new Timer (600000,1); 10 minutes
    applicationExitTimer.addEventListener (TimerEvent.TIMER_COMPLETE, exitApplication);
    applicationExitTimer.start ();
    }
    public void exitApplication(event:Event=null):void
    {
    NativeApplication.nativeApplication.exit ();
    }

    I guess that after 10 minutes of android has set the app to sleep

    I have an application that connects to a Web site every hour, but it doesn't work how I want that he

    If I use KEEP_AWAKE and then it does, screen stays on and app to focus the timer fires and it connects. If the user presses the power button to turn off the screen then the application goes to sleep and the timer stops

    unless the phone is plugged into the charger and the developer menu android is set to stay awake when debugging, then the screen can be turned off, but the application continues to run

    apparently there are new updates to come for flex that will allow more OS commands

    and there is somwhere on these forums a unoffical hack that allows you to save the application as a service, might be useful, that I have not tried

  • Create an eventlistener for a completed event

    I have a tween that I call a function and I would like an event of magnitude occur once the full interpolation.  I have never created a dependant of the listener event on the realisation of another action.

    Could someone suggest the best way approach this problem?  I'll be back cntcnt XandY scale to the newly created issue scprop of the TweenLite event.

    Here's the code that calls the interpolation.  I'd do it

    function clktwn(e:MouseEvent):void{
         //create vars for x,y cordinates of clicked county (child)
         var calledx:Number=cntcnt.allcnt_mc[xmlData.row.NAME[e.currentTarget.ivar]].x;
         var calledy:Number=cntcnt.allcnt_mc[xmlData.row.NAME[e.currentTarget.ivar]].y;
         //x and y coordinates of parent
         var goto:Point=new Point(0-calledx,-20-calledy);
         var wprop:Number=stage.stageWidth/cntcnt.allcnt_mc[xmlData.row.NAME[e.currentTarget.ivar]].width
         var hprop:Number=stage.stageHeight/cntcnt.allcnt_mc[xmlData.row.NAME[e.currentTarget.ivar]].height
         TweenLite.to(cntcnt.allcnt_mc,.5,{x:goto.x,y:goto.y});
         if (wprop>hprop){
                   var scprop:Number=hprop-2;
                   trace('height will be use as scaler',scprop)
                        } else {
                        var scprop:Number=wprop-2;
                        trace('width will be used as scaler',scprop)
                   }
    }
    

    Thanks in advance...

    Josh

    TweenLite has a property onComplete you can use:

    function clktwn(e:MouseEvent):void{     //create vars for x,y cordinates of clicked county (child)     var calledx:Number=cntcnt.allcnt_mc[xmlData.row.NAME[e.currentTarget.ivar]].x;     var calledy:Number=cntcnt.allcnt_mc[xmlData.row.NAME[e.currentTarget.ivar]].y;     //x and y coordinates of parent     var goto:Point=new Point(0-calledx,-20-calledy);     var wprop:Number=stage.stageWidth/cntcnt.allcnt_mc[xmlData.row.NAME[e.currentTarget.ivar]].width     var hprop:Number=stage.stageHeight/cntcnt.allcnt_mc[xmlData.row.NAME[e.currentTarget.ivar]].height     TweenLite.to(cntcnt.allcnt_mc,.5,{x:goto.x,y:goto.y,onComplete:tweenCompleteF});     if (wprop>hprop){               var scprop:Number=hprop-2;               trace('height will be use as scaler',scprop)                    } else {                    var scprop:Number=wprop-2;                    trace('width will be used as scaler',scprop)               }}
    
    function tweenCompleteF(){//do whatever}
    
  • EditManager.performRedo () should include redoPsuedoOp in the complete event

    I think it is a bug, but I just want to check.  In EditManager.performRedo (), dispatches a FlowOperationEvent.FLOW_OPERATION_COMPLETE event but happening in "op" as the operation parameter when I think he should spend in 'redoPsuedoOp '.  This would make it compatible with performUndo().  Without redoPsuedoOp of passage, it is difficult to tell from an event handler if the operation has a roll forward or any new operation.

    Looks like a bug to me.  Probably should have a check for _imeSession as well.  Hmmm so if performUndo.

    Thanks for the report.

    Richard

  • URGENT: How to identify Parent movie when we're inside the COMPLETE event

    Hi all
    I have try it for 4 days for a Solution, I don't know how to solve this problem.
    Well, I'll explain the Situation. I'm list creation of thumbnail using AS3 coding. Everything will work well.
    After the loading of the thumbnail, I want to resize the thumbnail to fit the size of the thumbnail. To set the exact size that I have to get the sample size movie that is placed inside the MC sticker, I can't able to get the name of the Instance. Here with, I have attached my sample Code. Please help me on this

    Try this code in onThumbLoaded:

  • How to raise an event when all the sounds in a soundchannel ends

    I have a soundchannel and I play a lot of sounds in there, but I need the fulfillment of any audio file within this channel to be followed by a two second wait, and then trigger an event. How can I do this?

    When the SoundChannel object is complete, there is a soundComplete event gets dispatched (Event.SOUND_COMPLETE).  Its assign a listener for the event.  If you need more information, the Flash help documentation has everything.

  • SoundChannel event.sound_complete does not? Help?

    Hello

    For some reason, my soundchannel event.sound_complete does not work. In fact, my class is to import its in and to allow the use to change their volumes and sound technology.

    This is the tutorial for speed

    http://blog.Andre-Michelle.com/2009/pitch-MP3/

    Right now, what I want to do is to auto loop back the song once the song ended the game, but I saw troubled do. No matter which, can help me?

    The code will pass by the SoundForward() function

    Inside, it will trigger _mp3.addEventListener (Event.COMPLETE, complete);

    and the activity function Rollback() will.

    Inside, it will trigger a _soundChannel.addEventListener (Event.SOUND_COMPLETE, loopMusic);

    but then the function fires once the song ended he played.

    Benson

    Thank you

    ------------------------------------------------------------------------------------------ -----

    {package examples

    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.SampleDataEvent;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.net.URLRequest;
    import flash.utils.ByteArray;

    SerializableAttribute public class SoundForward extends Sprite
    {
    private const blockSize:int = 3072;

    private var _mp3:Sound;
    private var _sound:Sound;
    private var _soundChannel:SoundChannel;

    private var _target:ByteArray;
    private var _position:Number;
    private var _rate:Number;
    private var _stop:Boolean;


    private var _pausePoint:Number;

    public void SoundForward (url: String, stop: Boolean)
    {
    _target = new ByteArray();

    _mp3 = new Sound();
    _mp3.addEventListener (Event.COMPLETE, complete);
    _mp3. Load (new URLRequest (url));

    _stop = stop;

    _pausePoint = 0;
    _position = 0.0;
    _rate = 1.0;

    _sound = new Sound();
    _sound.addEventListener (SampleDataEvent.SAMPLE_DATA, sampleData);

    _soundChannel = new SoundChannel();

    }

    private void complete(event:Event):void
    {
    _soundChannel = _sound.play ();
    _soundChannel.addEventListener (Event.SOUND_COMPLETE, loopMusic);
    }

    private void sampleData(event:SampleDataEvent):void
    {
    Reuse instead of leisure
    _target.position = 0;

    Shortcut
    var data: ByteArray = event.data;
    var scaledBlockSize:Number = blockSize * _rate;
    var positionInt:int = _position;
    var alpha: Number = _position - positionInt;

    var positionTargetNum:Number = alpha;
    var positionTargetInt:int = - 1;

    need var: int = Math.ceil (scaledBlockSize) + 2;
    var read: int = _mp3.extract (_target, need, positionInt);

    var n: int = read is need? blockSize: read / _rate;

    var l0:Number;
    var r0:Number;
    var l1:Number;
    var r1:Number;

    for (var i: int = 0; i < n; ++ i)
    {
    If (int (positionTargetNum)! = positionTargetInt)
    {
    positionTargetInt = positionTargetNum;

    Reading objective FIXED position
    _target.position = positionTargetInt < < 3.

    Read Stero two samples for linear INTERPOLATION
    L0 = _target.readFloat ();
    R0 = _target.readFloat ();

    L1 = _target.readFloat ();
    R1 = _target.readFloat ();
    }

    Write amplitudes interpolated streaming
    data.writeFloat (l0 + alpha * (l1 - l0));
    data.writeFloat (r0 + alpha * (r1 - r0));

    Increase the position of the target
    positionTargetNum += _rate;

    FRACTION OF THE INCREASE AND THE CLAMP BETWEEN 0 AND 1
    += Alpha _rate;
    While (alpha > = 1.0)-alpha;
    }

    -FILL the REST OF THE flow of DATA WITH zeros
    If (I < blockSize)
    {
    While (I < blockSize)
    {
    data.writeFloat (0,0);
    data.writeFloat (0,0);

    ++ i ;
    }
    }

    -INCREASE SOUND POST
    _position += scaledBlockSize;
    }

    private void loopMusic(e:Event):void
    {
    trace ("AB");
    }

    }
    }

    Use the code that I have suggested.  You should have only one sound (_mp3) instance in your code.

  • Dispatched event when a LONG list of custom converters made completely?

    I have a < s:List > custom component:

    < local id: ThumbnailList = 'list' top = down "0" = "0" left = "0" right = "0" dataProvider = '{image files' allowMultipleSelection = 'true' dragEnabled = "true" dragMoveEnabled = "true" / >


    Who extends sparks list and use the itemRendererFunction to create the custom ItemRenderer:

    SerializableAttribute public class ThumbnailList extends list
    {

    public void ThumbnailList()
    {
    Super();
    itemRendererFunction = getItemRenderer;

    }

    protected function getItemRenderer (data: Object): ClassFactory
    {
    var clz: class = DefaultItemRenderer;

    clz = ThumbnailRendererImpl;

    does not work: failed to add event listener to ItemRenderer

    clz.addEventListener ("renderComplete", function ends (event: Event): void {Alert.show ("make full...) ») ;}) ;
    return new ClassFactory (clz);
    }

    }

    And my custom ItemRenderer:

    <? XML version = "1.0" encoding = "utf-8"? >
    < s:ItemRenderer dataChange = "dataChangeHandler (event)" xmlns:fx =" " http://ns.Adobe.com/MXML/2009 "
    xmlns:MX = "library://ns.adobe.com/flex/mx" xmlns:s = "library://ns.adobe.com/flex/spark" >

    < fx:Script >
    <! [CDATA

    protected function dataChangeHandler(event:FlexEvent): void {}
    IMG.Soruce = data as a string;

    }

    private function loadComplete (event: Event): void {}
    dispatchEvent (new Event ("renderComplete"));
    }
    []] >
    < / fx:Script >
    < s:Graphic >
    < s:Group id = 'group' >
    < s:layout > < s:HorizontalLayout / > < / s:layout >
    < mx:Image id = "img" horizontalCenter = "0" = "0" Red complete = "loadComplete (event); » / >
    < / s:Group >
    < / s:Graphic >
    < / s:ItemRenderer >

    The dataprovider of this list is very large and the thumbnails that are created are also very wide... which means

    the list takes a long time to make completely.  Once the list is rendered completely, it works fine.  Now, since it

    takes a long time to make, I would like to add a popup or progress bar to show the user that the list is rendered.  Thus,.

    my question: is it possible to say when ALL the miniature custom renderers have all finished to load their respective

    image data?

    I have tried everything I can think and am unable to advance this project until I have a solution.

    Thank you!

    You can compare the number of events sent to the length of the dataProvider.

    This could be included in your custom list component then dispatch progress events and a complete event final...

    OR

    You could manage all this from outside the element of list in your application.  Just to set the events in the bubble of the ItemRenderer and pull

    dispatchEvent( new Event( "renderComplete", true ) );
    
  • Unable to access children in the init event or complete SWFLoader (numchildren =-1)

    Trying to put a label to a loaded flash (it is public), works fine if I call a timer and wait 2 seconds. Then I tried to do the 'right' way and it fails. (See the code example) Aparnently the flash charge (type FlashLoader) has a child (type SystemManager) with numChildren-1 at the event.

    Tried the init and event complete but no workie.
    http://livedocs.Adobe.com/Flex/3/langref/MX/controls/SWFLoader.html#summaryTableEvent
    init: dispatched when the properties and methods of a loaded SWF file are accessible.
    full: dispatched when the content is finished loading.

    Here is the code example:
    the file swf to load only fitted with a label with the id innerLabel and is called inner.swf

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML 'creationComplete = "init ();' >
    < mx:Script >
    <! [CDATA]
    import flash.display.DisplayObject;
    import flash.display.DisplayObjectContainer;
    import flash.events.TimerEvent;
    import flash.utils.Timer;
    Import mx.controls.Label;
    import flash.utils. *;
    Import mx.controls.SWFLoader;
    Import mx.core.Container;
    Import mx.core.FlexLoader;
    Import mx.managers.SystemManager;

    public var errors: Array = new Array();
    public var ld:SWFLoader = new SWFLoader();
    public void init (): void {}
    LD. Load ("Inner.swf");
    ld.addEventListener (Event.COMPLETE, setInnerLabel);
    this.addChild (ld);

    COMMENT THE ADDEVENTLISTENER METHOD AND UNCOMMENT THE LINES 3 AND IT WORKS
    LIKE A CHARM
    var t:Timer = new Timer(2000, 1);
    t.addEventListener (TimerEvent.TIMER, setInnerLabel);
    t.Start ();
    var doneTimer:Timer = new Timer (3000, 1);
    doneTimer.addEventListener (TimerEvent.TIMER, checkDone);
    doneTimer.start ();
    }
    public void checkDone(o:Object):void {}
    If (this.errors.length! = 0) {}
    trace (this.) Errors.Join ("\n"));
    } else {}
    trace ("done without error");
    }
    }

    public void setInnerLabel(o:Object):void {}
    var l:Label = getObjectsByProperty ("id", "innerLabel", Thi, null) [0] as Label;
    If (l == null) {}
    Errors.push ("unexpected innerLabel reduced label...");
    } else {l.text = "OK getbyid." ;}
    }
    {region for getElementById functions
    public void getObjectsByProperty (startFrom:DisplayObjectContainer,
    Public,
    PropertyValue:String,
    arrRet:Array = null): Array {}
    If (terminate == null) {}
    Terminate = new Array();
    }
    in the case where you pass a null value
    If (startFrom == null) {}
    return terminate;
    }
    If (startFrom.hasOwnProperty (propertyName)) {}
    If (startFrom [propertyName] = propertyvalue) {}
    arrRet.push (startFrom);
    }
    }
    trace ("HOW MANY of the CHILDREN:" + new String (startFrom.numChildren));
    traceElem (startFrom);
    for (var i: int = 0; i < startFrom.numChildren; i ++) {}
    traceElem (startFrom.getChildAt (i));
    If (startFrom.getChildAt (i) is DisplayObjectContainer) {}
    var tmpArr:Array = getObjectsByProperty (startFrom.getChildAt (i) as DisplayObjectContainer,
    propertyName, propertyvalue, terminate);
    Terminate = tmpArr;
    } else {}
    trace ("THE FOLLOWING WAS NOT A DISPLAYOBJECTCONTAINTER :");
    traceElem (startFrom.getChildAt (i));
    }
    }
    return terminate;
    }

    private void traceElem(elem:Object):void {}
    var x: XML = describeType (elem);
    var s:String = "got an item of the type:"+ x.attribute("name").toString ();.
    for (var i: int = 0; i < x.child("method").length (); i ++) {}
    If (x.child ("method") [i].attribute('name').toString () == 'getChildAt') {}
    s = s + "\n\t\t\tSupports getChildAt;
    }
    }
    for (i = 0; i < x.child("accessor").length (); i ++) {}
    If (x.child ("accessor") [i].attribute('name').toString () == 'numChildren') {}
    s = s + "\n\t\t\tSupports numChildren;
    s = s + "\n\t\t\tChildren:"+ new String ((elem.numChildren)); "
    }
    }
    trace (s);
    }
    } endregion
    []] >
    < / mx:Script >
    < / mx:Application >

    Common practice is to listen to the event APPLICATION_COMPLETE of SWFLoader.content once you get the COMPLETE event.  When loading a SWF Flex events really mean:

    Init: Enough of the properties and methods of SystemManager are available to implement the preloader, but we are waiting for the rest of the SWF file before we create all children whose main application:

    Full: All the bytes of the SWF file are downloaded, but we expect the event framework before the Framework 2 and the creation of the main application.

    So, your code would look more like:

    ld.addEventListener (Event.COMPLETE, completeHandler);

    function completeHandler(event:Event):void

    {

    ld.content.addEventListener (FlexEvent.APPLICATION_COMPLETE, setInnerLabel);

    }

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • Problem of event complete SWFLoader/Image (bug?)

    I have a SWFLoader in my application whose content is dynamically linked to a data grid for loading different images. Depending on the size of the new image I want to make some adjustments, etc. to the SWFLoader itself... is not important for now.

    The problem is that if I take the width of the SWFLoader instance on the 'complete' event, it gives the value for the PREVIOUS imaging so my math function is useless.

    Try this to see what I mean:
    [Bindable]
    public var imageSource:String;

    private void temp (): void {}
    mx.controls.Alert.show ("imgLoader.width:" + imgLoader.width);
    }
    ..
    < mx:Button click = "imageSource ="someImageURL"" / > "
    < mx:SWFLoader id = "imgLoader" autoLoad = "true" source = "{imageSource}" complete = "temp ()" / > "


    If you implement the code above, and assuming that imageSource is a string zero during initialization, you will get a value of '0' for the width of the imgLoader of the instance when you load a new image.

    To work around this problem in Flex 1.5, I could use doLater (Thi, "temp"), but doLater seems to have been deleted in Flex 2.0.

    My current work around is to change the above code as follows:

    private void temp (): void {}
    this.addEventListener ("enterFrame", blorch);
    }
    private void blorch(b:Event):void {}
    mx.controls.Alert.show ("imgLoader.width:" + imgLoader.width);
    this.removeEventListener ("enterFrame", blorch);
    }

    feels like a hack to me... is there any way to get this working without using the above functions? Kind of seems pointless to dismiss 'doLater' just to make me write a function that does essentially the same thing in Flex 2.0. I tried to use the 'resize' instead of 'complete' event and it works... If the loaded image is a different size than the previous. If the image is the same size (as is often the case in my application) then it does not work.

    All of the Adobe/Macromedia, fellow developers suggestions?

    Never thought to use "init", not sure it will work for images. The recommended solution is to subclass SWFLoader and override updateDisplayList

  • event 59 msvcrtd.dll on my program

    Hello

    I built a VC ++ 2008 / .NET based application that works well (debug and release versions) on my XP PC development.  I wish now to turn on my PC of deployment so I copied the version throughout.  My PC is a new one with all installed MS updates.
    When I try to run the version of deployment, I get an immediate failure with the usual "this application does not work" XP error message.

    I get nothing useful in the Application of the observer of events and anything section in the system section.  If I'm running on a PC XP 3, I get error messages in the system section.  Here, I find that the app is looking for Microsoft.VC90.DebugCRT - I guess that means msvcrtd.dll.

    By looking at the executable (release) with the Dependency Walker tool, I find that it depends on msvcrt.dll, not msvcrtd.dll.

    I have copied msvcrtd.dll on all PCs and have installed the vcredist module, but still not the same error.

    The complete event log message is:

    "Partial release failed for Microsoft.VC90.DebugCRT."  Reference error message: refereneces Assembly is not installed on your system. »

    Details
    -------

    Windows OS product
    ID 59
    Source SideBySide
    Version 5.2
    Symbolic name: MSG_SXS_FUNCTION_CALL_FAIL %1 failed for %2.  Error message reference %3.

    Thus, it seems that the app is a failure because Windows cannot load msvcrtd.dll - what is really there and is not necessary anyway.

    Someone at - it ideas?   I'm not an experienced programmer so please keep the simple answers.

    Hello
     
    Your question of Windows is more complex than what is generally answered in the Microsoft Answers forums. It is best suited for in the MSDN forums. Please post your question in the MSDN forum.
  • Problem with the entire event looks like a bug

    Hello

    I got a requirement like this, there are two text fields Textfield1 and Textfield2 to say, and Textfield1 is full it should automatically go to textfield2 and fill the characters typed on the keyboard. I had this implemented using comprehensive event. If Textfield1 is full change focus to Textfield2.

    Now, I met a very strange question, i.e., the last character I enter Textfield1 won't Textfield2. His only full because is triggered to the key of the last character.

    I tried other alternatives did not work.

    Guys, now I do not understand is that true. Someone had the same problem.

    Thank you for all that you do.

    Yes, I used this script

    xfa.host.setFocus ("TextField2");   in my complete case. However, I could solve the problem by using newText and limiting the length to 50.

    Now I got a different question, that is, it does not work if I enter all uppercase the TextField1.

    Reason for the number of characters is different for upper and lower case. Don't know how to handle this.

    In addition, I expect to complete event can be a solution in this case, however if I use full event and you change the focus to new textfield the last key shot strays.

    Any help on this would be much appreciated...

Maybe you are looking for