Maybe I don't understand your idea.
I checked
stage.addEventListener(Event.RESIZE, resizeHandler);
function resizeHandler(e:Event=null):void {
trace("stage "+stage.stageWidth)
}
That gives me
stage 999
stage 967
stage 911
stage 835
stage 790
stage 745
stage 705
stage 679
stage 674
stage 673
I need to do something only once after the last changes where stage is 673.
How Resize Event can help in this situation?
3 января 2012 г. 16:46 пользователь Cédric Muller <[email protected]> написал:
> or you could setup a CustomEvent.RESIZED thing that you throw when your
> resize code has been executed ... but you could also be ok by just calling a
> method /after/ the resize code/loop
>
> private function resizeHandler (e:Event):void {
> // resize code here (could be long)
> // resize code here
> // end of resize code/loop, now we dispatch a RESIZED event
> var ce:CustomEvent = new CustomEvent(CustomEvent.RESIZED);
> dispatchEvent(ce);
> }
>
> (your class needs to somewhat extend flash.events.EventDispatcher)
>
>> Or, if you really need to, you can do something like this:
>>
>> import flash.utils.setTimeout;
>> import flash.utils.clearTimeout;
>>
>> var timeOutID : uint;
>> stage.addEventListener(Event.RESIZE, resizeHandler, false, 0, true)
>>
>> function resizeHandler( e : Event = null ) : void {
>>
>> clearTimeout( timeOutID ) ;
>> timeOutID = setTimeout( resizeIsComplete , 250 );
>>
>> }
>>
>> function resizeIsComplete() : void {
>> trace('resizeIsComplete');
>> }
>>
>>
>>
>> On 3 Jan 2012, at 08:05, Cédric Muller wrote:
>>
>>> Yes, I know, but I interpreted what was needed, and I /think/ RESIZE does
>>> the job:
>>>
>>> RESIZE occurs
>>> your 'resize' code is executed
>>> when your code has been executed, it is RESIZEd.
>>>
>>> :) Ok, ok, I know
>>>
>>>> Cédric Muller skriver:
>>>>> stage.addEventListener(Event.RESIZE, resizeHandler, false, 0, true)
>>>>>
>>>>>
>>>>>
>>>>>> Is it possible to get information in swf from a browser that resizing
>>>>>> process is finished?
>>>>>>
>>>>
>>>> Sorry, but that event is not for when the resizing has finished. It is
>>>> when it is happening.
>>>>
>>>> _______________________________________________
>>>> Flashcoders mailing list
>>>> [email protected]
>>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>
>>>
>>> _______________________________________________
>>> Flashcoders mailing list
>>> [email protected]
>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>
>> _______________________________________________
>> Flashcoders mailing list
>> [email protected]
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders