Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Later
-
Adobe Flex SDK 4.1 (Release)
-
None
-
None
-
Affected OS(s): All OS Platforms
Affected OS(s): All OS Platforms
Language Found: English
Description
Steps to reproduce:
1. Create a component with a mx removedEffect;
2. On that same component create some transitions using spark effects. Make sure you can activate those transitions with your mouse, so you can detect the problem;
3. Do the code to remove the component you created, and make sure you are removing while a spark effect is running
------------------------------------
Actual Results:
A RTE is thrown (see below)
------------------------------------
Expected Results:
No RTE.
------------------------------------
The RTE:
file:/D:/webfuel/test/Notification/bin-debug/NotificationTest.html
Main Thread (Suspended: TypeError: Error #1009: Cannot access a property or method of a null object reference.)
mx.effects::EffectManager$/http://www.adobe.com/2006/flex/mx/internal::eventHandler
flash.display::DisplayObjectContainer/removeChild [no source]
mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::$removeChild
mx.core::UIComponent/removeChild
spark.components::Group/http://www.adobe.com/2006/flex/mx/internal::elementRemoved
spark.components::Group/removeElementAt
spark.components::Group/removeElement
pt.webfuel.core.notification.view::NotificationsBox/notifications_collectionChangeHandler
flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
mx.collections::ListCollectionView/dispatchEvent
mx.collections::ListCollectionView/removeItemsFromView
mx.collections::ListCollectionView/listChangeHandler
flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
mx.collections::ArrayList/internalDispatchEvent
mx.collections::ArrayList/removeItemAt
mx.collections::ListCollectionView/removeItemAt
pt.webfuel.core.notification.model.managers::NotificationManager/removeNotification
pt.webfuel.core.notification.model.managers::NotificationManager/notification_hideNotificationHandler
flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
pt.webfuel.core.notification.model.data::Notification/hide
pt.webfuel.core.notification.model.data::Notification/timer_completeHandler
flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
flash.utils::Timer/tick [no source]
------------------------------------
The problematic code (EffectManager, line 605):
for (var i:int = 0; i < UIComponent(eventObj.target)._effectsStarted.length; i++)
{ // Don't allow removedEffect to trigger more than one effect at a time if (UIComponent(eventObj.target)._effectsStarted[i].triggerEvent.type == Event.REMOVED) return; }triggerEvent is null for the first effect.
------------------------------------
The watch report for the _effectsStarted Array
UIComponent(eventObj.target)._effectsStarted = Array (@16b65201)
[0] = spark.effects.supportClasses.ResizeInstance (@119e4c29)
[1] = mx.effects.effectClasses.MoveInstance (@16b52971)
[2] = mx.effects.effectClasses.MoveInstance (@16b523f9)
length = 3
------------------------------------
The watch report for the first element in the _effectsStarted array:
[0] = spark.effects.supportClasses.ResizeInstance (@119e4c29)
[inherited] =
target = pt.webfuel.core.notification.view.renderers.NotificationRenderer (@16afc851)
_target = pt.webfuel.core.notification.view.renderers.NotificationRenderer (@16afc851)
triggerEvent = null
_triggerEvent = null
-------------------------------------
Solution:
Do a null check on triggerEvent