cancel
Showing results for 
Search instead for 
Did you mean: 

Flash Island: Change values during initialization

Former Member
0 Kudos

Hi @all!

How can change the values of an ArrayCollection during initialization?

Here is my code-snippet(this is just an example):


[Bindable]
public var dataSource:ArrayCollection = new ArrayCollection();

public function initApp():void{
FlashIsland.register(this);

showMessage();
}

public function showMessage():void{

for (var j:uint = 0; j < dataSource.length; j++) {
    Alert.show(dataSource[j].ID;
}

}

The error message is: Error #1009: Cannot access a property or method of a null object reference

Is it posible to access a dataSource with a timer-method? Or how can I change the properties of a dataSource without using click-Events?

Thanks for your help,

Dirk

Edited by: D.Sorgatz on Mar 12, 2010 3:48 PM

Edited by: D.Sorgatz on Mar 12, 2010 3:58 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

by the time your showMessage() called the datasource is empty.

data passed to flash island from web dynpro is asynchronous in nature.

create a public set and get functions for the variable dataSource in the set Function call showMessage() method

http://www.adobe.com/devnet/sap/xml/popup_vid_07.html

Abhi