Backendless Support
 
Answered

I don't understand BackendlessCollection for FLASH/AS3

I don't understand it.

When I do:

Backendless.Data.of( Noticias ).last( responder );

I get just 1 Noticias Object. So far so good.

But when I do:

Backendless.Data.of(Noticias).find(query,responder);

I cant go thru all objects!!

In fact, totalObjects and lenght gives me different value...

What is the right way of going thru an BackendlessCollection object and retrieve all entries?

Thanks

  1. public function describeObject():void{
  2. var responder:IResponder = new Responder(gotResult,gotError);
  3. var query:BackendlessDataQuery = new BackendlessDataQuery();
  4. query.whereClause = "titulo != 'PIM'";
  5. Backendless.Data.of(Noticias).find(query,responder);
  6. }
  7. public function gotResult(evt:ResultEvent):void{
  8. var resultado = evt.result as BackendlessCollection;
  9. var noti:BackendlessCollection = evt.result as BackendlessCollection;
  10. trace(resultado.totalObjects) --> 7
  11. trace(noti.length) --> 0
  12. }

Leave a Comment

Comments (2)

photo
1

Ok, got it XD

noti.currentPage.length --> 7

Thanks!

photo
1

"last" - returns object most recently added to table

"find" - returns a collection of objects.

do this: noti.getCurrentPage().length