|
Home > Archive > Macromedia Flash Server > May 2005 > dataProvider
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| James Rowley 2005-05-05, 5:45 pm |
| If i was making my own components - or even just wanting to define a
dataProvider method to some custom code - exactly how can i integrate
dataProvider into my stuff?
Do i just extend the dataProvider class?
J
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
| |
| JesterXL 2005-05-05, 5:45 pm |
| DataProvider, in AS2 component framework, is an API mixin combo, not a class
you should extend.
By default, if you have a List component in your movie, it'll turn ALL
Array's into a dataprovider.
simplest way is:
static var mixIt2 : Boolean = DataProvider.Initialize(Array);
To get your class to use a dataprovider, you can do:
private var _dp:Array;
public function get dataProvider():Array
{
return _dp;
}
public function set dataProvider(val:Array):Void
{
_dp = val;
_dp.removeEventListener("modelChanged", this);
_dp.addEventListener("modelChanged", this);
modelChanged();
}
And then, in your modelChanged, just refresh your GUI from the _dp variable;
treat it as an array.
Keep in mind, however, if you do _dp.push, modelChanged won't get fired for
anyone else listening to it, use the dataProvider methods like addItem, etc.
----- Original Message -----
From: "James Rowley" <james-mcNH3L9qnnvQT0dZR+AlfA@public.gmane.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Thursday, May 05, 2005 4:54 PM
Subject: [FlashComm] dataProvider
If i was making my own components - or even just wanting to define a
dataProvider method to some custom code - exactly how can i integrate
dataProvider into my stuff?
Do i just extend the dataProvider class?
J
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
| |
| James Rowley 2005-05-05, 5:45 pm |
| thanks jesse ;)
JesterXL wrote:
>DataProvider, in AS2 component framework, is an API mixin combo, not a class
>you should extend.
>
>By default, if you have a List component in your movie, it'll turn ALL
>Array's into a dataprovider.
>
>simplest way is:
>
>static var mixIt2 : Boolean = DataProvider.Initialize(Array);
>
>To get your class to use a dataprovider, you can do:
>
>private var _dp:Array;
>
>public function get dataProvider():Array
>{
> return _dp;
>}
>
>public function set dataProvider(val:Array):Void
>{
> _dp = val;
> _dp.removeEventListener("modelChanged", this);
> _dp.addEventListener("modelChanged", this);
> modelChanged();
>}
>
>And then, in your modelChanged, just refresh your GUI from the _dp variable;
>treat it as an array.
>
>Keep in mind, however, if you do _dp.push, modelChanged won't get fired for
>anyone else listening to it, use the dataProvider methods like addItem, etc.
>
>
>----- Original Message -----
>From: "James Rowley" <james-mcNH3L9qnnvQT0dZR+AlfA@public.gmane.org>
>To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
>Sent: Thursday, May 05, 2005 4:54 PM
>Subject: [FlashComm] dataProvider
>
>
>If i was making my own components - or even just wanting to define a
>dataProvider method to some custom code - exactly how can i integrate
>dataProvider into my stuff?
>
>Do i just extend the dataProvider class?
>
>J
>
>=-----------------------------------------------------------
>Supported by Fig Leaf Software - http://www.figleaf.com
>=-----------------------------------------------------------
>
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>
>=-----------------------------------------------------------
>Supported by Fig Leaf Software - http://www.figleaf.com
>=-----------------------------------------------------------
>
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
|
|
|
|
|