[flexcoders] Set the FrameRate

2009-03-01 Thread christophe_jacquelin
Hello,

How to set the FrameRate of a .SWF file opened with SWFLoader ?

Thank you,
Christophe, 




[flexcoders] Re: Getting ByteArray.uncompress() to work in Flash - looking for an example text with compressed bytes

2009-03-01 Thread David Adams
 * Perhaps there's something messed up in my compression data - would
 someone be willing to post some kind of 'hello world' in plain text
 and compressed form that is known to work with ByteArray.uncompress()?
 From there, I can experiment and see if I can tinker with my
 compression settings (or switch compression libraries) until I get a
 match.

P.S. If possible, I'm looking for a hello world XML message example
that has been compressed on the server, sent over HTTP and then
unpacked using ByteArray.uncompress() in Flash.

Many thanks in advance for any help.


[flexcoders] Re: Sending POST requests to php script??Help

2009-03-01 Thread fprihoda
This doe not work, as I am not trying to make the object bindable.  I
am simply trying to reference the object values and pass them as part
of the HTTPService request.

--- In flexcoders@yahoogroups.com, Jim Hayes j...@... wrote:

 I'm making a wild guess here, but does this work?
 
 mx:request xmlns=
 first{modelName.name.first}/first
 last{modelName.name.last}/last
 email{modelName.email}/email
 /mx:request
 
 Apologies if not, I've not made any attempt to see if it does so it
could be utter rubbish.
 
 
 -Original Message-
 From: flexcoders@yahoogroups.com on behalf of fprihoda
 Sent: Sat 28/02/2009 19:09
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Sending POST requests to php script??Help
  
 The following code is not working as I would expect it to.
 
 mx:HTTPService id=srv2 url=http://localhost/flex_web/addform.php;
 resultFormat=object showBusyCursor=true
 result=resultHandler(event) method=POST
 mx:request xmlns=
 firstmodelName.name.first/first
 lastmodelName.name.last/last
 emailmodelName.email/email
 /mx:request
 /mx:HTTPService
 
 modelName is an object. I would like to send the POST variables to the
 php script using dot notation as shown above. The problem I am having
 is that it sends the entire string modelName.xxx.xxx instead of the
 actual object field.  I think this is a dereferencing issue, but I do
 not know how to fix it.
 
 Can someone help?
 
 
 
 __
 This communication is from Primal Pictures Ltd., a company
registered in England and Wales with registration No. 02622298 and
registered office: 4th Floor, Tennyson House, 159-165 Great Portland
Street, London, W1W 5PA, UK. VAT registration No. 648874577.
 
 This e-mail is confidential and may be privileged. It may be read,
copied and used only by the intended recipient. If you have received
it in error, please contact the sender immediately by return e-mail or
by telephoning +44(0)20 7637 1010. Please then delete the e-mail and
do not disclose its contents to any person.
 This email has been scanned for Primal Pictures by the MessageLabs
Email Security System.
 __





[flexcoders] Re: Sending POST requests to php script??Help

2009-03-01 Thread fprihoda
When I do so, I get the following warnings in the console display:

warning: unable to bind to property 'email' on class 'Object' (class
is not an IEventDispatcher)
warning: unable to bind to property 'name' on class 'Object' (class is
not an IEventDispatcher)
warning: unable to bind to property 'last' on class 'Object' (class is
not an IEventDispatcher)
warning: unable to bind to property 'first' on class 'Object' (class
is not an IEventDispatcher)

In addition, nothing is passed to my php script.

Frank
--- In flexcoders@yahoogroups.com, Paul Kukiel pkuk...@... wrote:

 You nee to put { } around the variables ie:
 
 mx:request xmlns=
 first{modelName.name.first}/first
 last{modelName.name.last}/last
 email{modelName.email}/email
 /mx:request
 
 
 
 Paul
 
 On 28/02/2009, at 2:09 PM, fprihoda wrote:
 
  The following code is not working as I would expect it to.
 
  mx:HTTPService id=srv2 url=http://localhost/flex_web/addform.php;
  resultFormat=object showBusyCursor=true
  result=resultHandler(event) method=POST
  mx:request xmlns=
  firstmodelName.name.first/first
  lastmodelName.name.last/last
  emailmodelName.email/email
  /mx:request
  /mx:HTTPService
 
  modelName is an object. I would like to send the POST variables to the
  php script using dot notation as shown above. The problem I am having
  is that it sends the entire string modelName.xxx.xxx instead of the
  actual object field. I think this is a dereferencing issue, but I do
  not know how to fix it.
 
  Can someone help?
 
 





[flexcoders] Re: Image scaleContent=false causes Security Sandbox Violation in AIR 1.5.x

2009-03-01 Thread Shigeru Nakagaki
I'm a freelance and some of my customers use FlexBuilder to customize
app which I made :(

When they see Security Sandbox Violation in console, it's so hard to
explain.

# Especially the Japanese really minds about these tiny things.



[flexcoders] Re: Getting ByteArray.uncompress() to work in Flash - looking for an example text with compressed bytes

2009-03-01 Thread Cato Paus
go here
http://onrails.org/articles/2007/11/27/flash-utils-bytearray-compressing\
-4-1mb-to-20k
http://onrails.org/articles/2007/11/27/flash-utils-bytearray-compressin\
g-4-1mb-to-20k
--- In flexcoders@yahoogroups.com, David Adams dpad...@... wrote:

 I've been having no luck getting Flex to decompress some data I've
 compressed using a tool based on zlib. I've tried the same code using
 AIR where I can specify the compression method and the data *does*
 decompress correctly. Below is a bit of code to give the idea:

 public function onComplete(event:Event) : void{
 var loader:URLLoader = URLLoader(event.target);
 //var info:String = loader.data;
 //trace(info);
 var ba:ByteArray = new ByteArray;
 ba = loader.data as ByteArray;
 ba.position = 0;
 // The next line of code fails with error #2058 every time using Flex.
 // Under AIR - you can get it to work by specifying the
 decompression method as DEFLATE.
 ba.uncompress();
 // For the AIR application, the line above is
 // ba.uncompress(CompressionAlgorithm.DEFLATE);
 var bytes:String = bytes = ba.toString();
 Alert.show(bytes.toString()); // AIR shows the original string,
 Flex never gets this far.
 }

 A couple of questions:

 * Does it matter what MIME type is set on the Web server for the
 content? If so, what MIME type is likely to work.

 * What decompression method exactly does the Flash player support?
 I've read deflate - which AIR seems to handle when I specify
 DEFLATE.

 * Perhaps there's something messed up in my compression data - would
 someone be willing to post some kind of 'hello world' in plain text
 and compressed form that is known to work with ByteArray.uncompress()?
 From there, I can experiment and see if I can tinker with my
 compression settings (or switch compression libraries) until I get a
 match.

 Thanks in advance for any help.




[flexcoders] Asp Dating Scripts

2009-03-01 Thread ngsri_kanth

Full customizable dating script coded in asp, ms access
for more details
visit http://www.websol-dating-software.com
and download
customizable dating scripts in asp



[flexcoders] Thumbnail from screen (contents)

2009-03-01 Thread erikdebruin_nl
Hi all,

I'm trying to find a way to construct thumbnails from the screens of
my presentation tool. The application I'm working on takes an XML
files, constructs screens with text, images and video from it's
contents and displays these, much like PowerPoint would. I want to use
thumbnails of the various screens to give the user a visual indication
of what screen he will be navigating to. So I'm not only working with
the current display, but also future and past displays, an actual
resized screenshot will not do.

I figure I have to create instances of the texts and images, convert
these to bitmapdata (or somesuch), add them together, scale the result
and voila!

I have Googled me senseless but I can't figure it out :-(

Can anybody help?

Thanks in advance,

EdB



[flexcoders] redundancy in custom ItemRenderer

2009-03-01 Thread flexrookie
another question about ItemRenderers, using my previous stock example.

i have noticed that my custom item renderer seems to be performing
redundant executions. for a single dataProvider item, i see two
renderer instances created. and for each instance, set data and
commitProperties() are called repeatedly. 

here's my code:

StockApp.mxml
===
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute
  applicationComplete=applicationCompleteListener(event)
mx:Script
  ![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.HorizontalList;
import mx.events.FlexEvent;
import mx.core.ClassFactory;

protected var list:HorizontalList;
protected var provider:ArrayCollection;

protected function applicationCompleteListener (e:FlexEvent):void {
  // Provider
  provider = new ArrayCollection();
  provider.addItem({stockInfo:new StockInfo()});
  
  // UI
  list = new HorizontalList();
  list.width = 400;
  list.height = 100;
  list.dataProvider = provider;
  list.itemRenderer = new ClassFactory(StockInfoRenderer);
  
  addChild(list);
} 
  ]]
/mx:Script
/mx:Application
===

StockInfoRenderer.as
===
package {
  import mx.containers.Canvas;
  import mx.controls.Button;
  
  public class StockInfoRenderer extends Canvas {
protected var button:Button;

public function StockInfoRenderer () {
  trace(StockInfoRenderer CONSTRUCTOR CALLED.);
}

override protected function createChildren ():void {
  trace(StockInfoRenderer CREATE CHILDREN CALLED.);
  super.createChildren();
  
  if (button == null) {
button = new Button();
button.width = 100;
  }
  addChild(button);
}

override protected function commitProperties ():void {
  trace(StockInfoRenderer COMMIT PROPERTIES CALLED.);
  super.commitProperties();

  button.label = data.stockInfo.getPrice();
}

override public function set data (value:Object):void {
  trace(StockInfoRenderer SET DATA CALLED.);
  super.data = value;
  invalidateProperties()
}
  }
}
===


OUTPUT:
===
StockInfoRenderer CONSTRUCTOR CALLED.
StockInfoRenderer CREATE CHILDREN CALLED.
StockInfoRenderer SET DATA CALLED.
StockInfoRenderer COMMIT PROPERTIES CALLED.
StockInfoRenderer SET DATA CALLED.
StockInfoRenderer COMMIT PROPERTIES CALLED.

StockInfoRenderer CONSTRUCTOR CALLED.
StockInfoRenderer SET DATA CALLED.
StockInfoRenderer CREATE CHILDREN CALLED.
StockInfoRenderer COMMIT PROPERTIES CALLED.
===

is the preceding redundancy typical, or am i doing something wrong?

~flashrookie



[flexcoders] updating an item renderer

2009-03-01 Thread flexrookie
hi list, first post...

i have an architectural question about datatproviders and
itemrenderers that i'll pose with a canonical example.

suppose i have an array of StockInfo objects that is populated by a
3rd party library. each StockInfo object dispatches UPDATE events when
a stock price changes. i want to render the prices in HorizontalList
with a custom renderer.

here's the general application shell:

=
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute
  applicationComplete=applicationCompleteListener(event)
mx:Script
  ![CDATA[
import mx.controls.HorizontalList;
import mx.events.FlexEvent;
import mx.core.ClassFactory;

protected var list:HorizontalList;
protected var stocks:Array;

protected function applicationCompleteListener (e:FlexEvent):void {
  // Stock data (hardcoded for the example)
  stocks = [new StockInfo()];

  // UI
  list = new HorizontalList();
  list.width = 400;
  list.height = 100;
  list.itemRenderer = new ClassFactory(StockInfoRenderer);
  addChild(list);
} 
  ]]
/mx:Script
/mx:Application
=

i need to wire the stocks array to the list. of course, given that i
already have an array of StockInfo objects, it's tempting to make an
ArrayCollection wrapper that gives direct access to the StockInfo
objects. e.g.,

provider = new ArrayCollection();
provider.addItem({stockInfo:someStockInfoObject});

then the StockInfoRenderer could register for UPDATE events and redraw
when the event occurs. but i'm hesitant about that approach. if i went
that route,

1) within the StockInfoRenderer, where would i register for the UPDATE
event? in commitProperties()?
2) within the StockInfoRenderer, where would i *remove* the UPDATE
listener?
3) given that renderers are reused, are there issues with synching, or
with stranded listeners causing memory build-up?

more generally, what's the right way to wire my list to the stocks
array? it feels like i might be forced to handle UPDATE for each
StockInfo object, and write a 'price' variable into a data provider.
e.g., 

provider.getItemAt(i).price = value;
provider.itemUpdated(provider.getItemAt(i), price);

seems a shame, given that i already have an array of StockInfo
objects. the above two lines presuppose that i'm going to hunt for the
item index every time a stock price changes. : (

another general question, do i even need the itemUpdate() call, or is
that part automated?

thanks for any advice!

flexrookie



[flexcoders] Re: display row index in DataGrid

2009-03-01 Thread Amy
--- In flexcoders@yahoogroups.com, rueter007 rueter...@... wrote:

 Finding the index of an item in a dataprovider will not work if he is
 using filters. I think he wanted to always show the correct row number
 (starting with 1) even after filtering the data. What Alex mentioned
 is the right approach for this problem.

The approach I gave him will give him what he wants.  He doesn't want 
the original row number with gaps where the filtered items were left 
out, but rather the new row numbers after filtering, which is what this 
gives (at least the ListCollectionView approach...not as sure about the 
XML approach).



[flexcoders] Re: display row index in DataGrid

2009-03-01 Thread Amy
--- In flexcoders@yahoogroups.com, nylarch kmichaelschwa...@... 
wrote:

 Thanks for the help everyone.
 
 Yes - that's correct - I always want the index to start with 1 post-
filtering

Which is what oyu'll get if you use the ListCollectionView approach.

HTH;

Amy



[flexcoders] Re: Adding verticalaxis(es) via actionscript

2009-03-01 Thread Amy
--- In flexcoders@yahoogroups.com, Trefalgar Bain trefal...@... 
wrote:

 --- In flexcoders@yahoogroups.com, Amy amyblankenship@ wrote:
  Have you checked out this example?
  http://flexdiary.blogspot.com/2008/08/charting-example.html
 
 Below is what I've ended up with. Allowing each line to have its own
 axis, it does adjust each max/min axis as expected, but I don't get 
a
 line on the actual graph. If I use the below code, I get the two
 axises like I want, but the default axis isn't adjusting to the 
lines
 that I think are latched to it (I also still don't get any lines on
 the graph).

A quick scan of your code isn't revealing to me what you changed.  
Could you add in comments that show where you've modified it?

Also, usually when I have had problems with not seeing lines on the 
graph it is because the data functions aren't returning properly, so 
I'd put trace statements in the data functions to see what they're 
returning.

HTH;

Amy



[flexcoders] Re: Compressing messages/data: What binary/compression formats are workable in Flex?

2009-03-01 Thread Amy
--- In flexcoders@yahoogroups.com, David Adams dpad...@... wrote:

 I'm working on a system that transfers data from a back-end to Flex
 for display and manipulation. In this case, I can control the 
message
 format on the server-side. I'm pretty happy sending XML because of 
how
 easy it is to work with XML in Flex. On the other hand, XML is
 sometimes ridiculously inefficient as a message format as it tends 
to
 be pretty bloated. I'm imagining a few strategies:
 
 * Strip and reduce the XML to use stupidly short element names and 
no
 spare white-space to reduce the message size a bit.
 This is a weak option in a lot of ways but it's easy to do.
 
 * Compress the XML and decompress it in Flex.
 This is an appealing option as I get to work with the XML but don't
 have such big messages. Unfortunately, I haven't been able to get 
this
 to work using zlib and ByteArray.uncompress(). I'll also assume that
 there is some kind of sweet-spot when the cost of
 compression/decompression outweighs the cost of the larger message.
 Once I get this working, I could try to figure out when compression 
is
 worth engaging and then have the server compress when it (guesses) 
it
 will make sense.
 
 * Use AMF.
 Can't. It's not supported on the server and a project constraint is
 thou shalt not implement binary protocols by hand.
 
 * Use a custom binary format, package the data that way on the 
server,
 and then write a custom parser in Flex.
 Can't. See previous point and another project constraint, thou 
shalt
 not invent new binary formats.
 
 * Use another binary format that Flex does understand.
 Are there any?
 
 Basically, I'm looking for an efficient message transfer format 
that I
 don't have to invent or hand-code.

Plain text.  Long before the invention of XML, developers used csv 
or  csv-like files to power their data-driven apps.  You'll have to 
load the plain text into objects, but hopefully you don't have a 
constraint against that :o)



[flexcoders] Re: Detecting iterations in item render

2009-03-01 Thread rob_mcmichael
Thanks Alex, I was working with a list:

if( ( 
(List(this.owner).verticalScrollPosition + _listData.rowIndex) % 2) 
== 1  )
{
this.styleName = 
categoryRowAlt;
}
else
{
this.styleName = categoryRow;
}

and it works a treat!

Thanks to all that helped!

Rob


--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 More specifically, for a DataGrid:
 
 If (((DataGrid(this.owner).verticalScrollPosition + listData.rowIndex) % 2) 
 == 1)
 
 Alex Harui
 Flex SDK Developer
 Adobe Systems Inc.http://www.adobe.com/
 Blog: http://blogs.adobe.com/aharui
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On 
 Behalf Of 
rob_mcmichael
 Sent: Saturday, February 28, 2009 3:33 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Detecting iterations in item render
 
 
 I have tried your suggestion implementing 
mx.controls.listClasses.IDropInListItemRenderer:
 
 this.styleName = categoryRowAlt;
 trace( this.owner.verticalScrollPosition );
 if( (_listData.rowIndex % 2) == 1 )
 {
 this.styleName = categoryRowAlt;
 }
 else
 {
 this.styleName = categoryRow;
 }
 
 Although the trace has an error by not being able to access possible 
 undefined var.
 
 Obviously it works apart from when you scroll :/
 
 Any other ideas?
 
 Thanks
 
 Rob





[flexcoders] Flex receives generic Object types from Zend AMF

2009-03-01 Thread dejanstokanic
Hi Guys.
I've got a strange problem with VO's in Flex.

I've got my Flex set up correctly and AMF connection to PHP code with
the help of Zend framework.

Here's the problem:
I've been sending VO's so far with no problem. PHP creates a new object
e.g VOUser. Fills the data and returns the object as VOUser.
Flex on the other side gets the response event (ResultEvent) and
event.result type is VOUser.

Then I've created a new VO - VOReport and PHP returns a new VOReport -
I've tested this with Charles http://www.charlesproxy.com/  .
But Flex receives a generic Object instead of VOReport.

VOReport.as code :
 [RemoteClass(alias=VOReport)]
 [Bindable]
 public class VOReport
 {
 public var name:String;
 public var parentId:int;
 }

VOReport.php
?php
class VOReport {

 public $name;
 public $parentId;
}

index.php is ofcorse mapped.

and a simple php function
 public function getReports()
 {
 $a = new VOReport();
 $a-name = Report 1;
 return $a;
 }

I could typecast the object but the function will be designed to return
diffrent object types...

Help is appreciated :)




[flexcoders] Binding property of object in dataProvider

2009-03-01 Thread gwangdesign
I am trying to bind a property (label) in my data object so that the
changes on it can be propagated to all the views (The controls may
want to edit this property). Currently I am wrapping them as plain
objects in ArrayCollection and I got the following warning:

warning: unable to bind to property 'label' on class 'Object' (class
is not an IEventDispatcher)

Does the compiler suggest making the Object a subclass of
IEventDispatcher? How do I do it if so?

My code is as below. Thanks!

mx:ArrayCollection id=taskList
mx:Object label=Word/
mx:Object label=Media Player/
mx:Object label=Contacts/
mx:Object label=Apache Server/
mx:Object label=Dictionary/
mx:Object label=iTunes/
mx:Object label=Solitaire/
mx:Object label=Minesweeper/
mx:Object label=Safari/
mx:Object label=RSS Reader/
/mx:ArrayCollection
mx:VBox
mx:Repeater id=myRP dataProvider={taskList} 
recycleChildren=true
mx:Button horizontalCenter=0
label={String(myRP.currentItem.label)}
click=button_ClickHandler(event);/
/mx:Repeater
/mx:VBox 



RE: [flexcoders] Re: Sending POST requests to php script??Help

2009-03-01 Thread Jim Hayes
Well, I believe the syntax is correct, at least!
The warnings are telling you something, in a way, which is that unless your 
objects properties are bindable flex won't be able to detect changes in them at 
runtime.
Hence it won't work if as you might expect you want to specify the request in 
mxml like that. 
It's just the way flex works, I found it a little hard to get used to at first.
You might have better results if you call an actionscript function to set the 
request object instead.


-Original Message-
From: flexcoders@yahoogroups.com on behalf of fprihoda
Sent: Sun 01/03/2009 12:51
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Sending POST requests to php script??Help
 
This doe not work, as I am not trying to make the object bindable.  I
am simply trying to reference the object values and pass them as part
of the HTTPService request.

--- In flexcoders@yahoogroups.com, Jim Hayes j...@... wrote:

 I'm making a wild guess here, but does this work?
 
 mx:request xmlns=
 first{modelName.name.first}/first
 last{modelName.name.last}/last
 email{modelName.email}/email
 /mx:request
 
 Apologies if not, I've not made any attempt to see if it does so it
could be utter rubbish.
 
 
 -Original Message-
 From: flexcoders@yahoogroups.com on behalf of fprihoda
 Sent: Sat 28/02/2009 19:09
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Sending POST requests to php script??Help
  
 The following code is not working as I would expect it to.
 
 mx:HTTPService id=srv2 url=http://localhost/flex_web/addform.php;
 resultFormat=object showBusyCursor=true
 result=resultHandler(event) method=POST
 mx:request xmlns=
 firstmodelName.name.first/first
 lastmodelName.name.last/last
 emailmodelName.email/email
 /mx:request
 /mx:HTTPService
 
 modelName is an object. I would like to send the POST variables to the
 php script using dot notation as shown above. The problem I am having
 is that it sends the entire string modelName.xxx.xxx instead of the
 actual object field.  I think this is a dereferencing issue, but I do
 not know how to fix it.
 
 Can someone help?
 
 
 
 __
 This communication is from Primal Pictures Ltd., a company
registered in England and Wales with registration No. 02622298 and
registered office: 4th Floor, Tennyson House, 159-165 Great Portland
Street, London, W1W 5PA, UK. VAT registration No. 648874577.
 
 This e-mail is confidential and may be privileged. It may be read,
copied and used only by the intended recipient. If you have received
it in error, please contact the sender immediately by return e-mail or
by telephoning +44(0)20 7637 1010. Please then delete the e-mail and
do not disclose its contents to any person.
 This email has been scanned for Primal Pictures by the MessageLabs
Email Security System.
 __





__
This communication is from Primal Pictures Ltd., a company registered in 
England and Wales with registration No. 02622298 and registered office: 4th 
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT 
registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and 
used only by the intended recipient. If you have received it in error, please 
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 
1010. Please then delete the e-mail and do not disclose its contents to any 
person.
This email has been scanned for Primal Pictures by the MessageLabs Email 
Security System.
__winmail.dat

Re: [flexcoders] Thumbnail from screen (contents)

2009-03-01 Thread Weyert de Boer
Hi Erik,

You can easily make a screenshot of a MovieClip the following way:
import flash.display.*;

var thumbnailData: BitmapData =  new BitmapData( slide._width, 
slide._height, true, 0xFF );
thumbnailData.draw( slide, new Matrix() );

After you made a screenshot of the movieclip or you slide you can reuse 
it by it like:

slideThumb.attachBitmap( thumbnailData, 1);

Yours,
Weyert de Boer


[flexcoders] access current item in outer document/ getRepeaterItem not working

2009-03-01 Thread gwangdesign
Hi,

Basically I am feeding dataProvider for 2 set of controls: one is on
my main app and one is the item renderers of a TileList, both of which
are Buttons. I am assigning the same function at main app to handle
their click event. The event handler assigned to the controls in the
main app works fine but not for those in the item renderers. I get
null object at runtime on
Button(event.currentTarget).getRepeaterItem(). Below is the code:

!--code in main Script tag--
public function button_ClickHandler(event:MouseEvent):void
{
//get the current item. This works for controls 
that are directly
instantiated in main application. But not for nested itemRenderers.
See mxml below.
var item:Object = 
Button(event.currentTarget).getRepeaterItem();
var index:int = taskList.getItemIndex(item);
if(index != -1)
{
taskList.removeItemAt(index);
taskList.addItemAt(item, 0);
}
}

mx:ArrayCollection id=taskList
mx:Object label=Word/
mx:Object label=Media Player/
mx:Object label=Contacts/
mx:Object label=Apache Server/
mx:Object label=Dictionary/
mx:Object label=iTunes/
mx:Object label=Solitaire/
mx:Object label=Minesweeper/
mx:Object label=Safari/
mx:Object label=RSS Reader/
/mx:ArrayCollection

!--code for item renderers--
mx:TileList dataProvider={taskList}
mx:itemRenderer
mx:Component
mx:Button styleName=myButtonStyle
click=parentDocument.button_ClickHandler(event);/
/mx:Component
 /mx:itemRenderer
/mx:TileList

I tried to trace and it seems the Buttons inside itemRenderer can
access the dataProvider in the outer document. But getCurrentItem()
breaks. So how do I get the current item from the currentTarget?



[flexcoders] Re: access current item in outer document/ getRepeaterItem not working

2009-03-01 Thread gwangdesign
I got around it by using the data property of itemrenderer, instead of
getCurrentItem()...


--- In flexcoders@yahoogroups.com, gwangdesign gwangdes...@... wrote:

 Hi,
 
 Basically I am feeding dataProvider for 2 set of controls: one is on
 my main app and one is the item renderers of a TileList, both of which
 are Buttons. I am assigning the same function at main app to handle
 their click event. The event handler assigned to the controls in the
 main app works fine but not for those in the item renderers. I get
 null object at runtime on
 Button(event.currentTarget).getRepeaterItem(). Below is the code:
 
 !--code in main Script tag--
 public function button_ClickHandler(event:MouseEvent):void
   {
   //get the current item. This works for controls 
 that are directly
 instantiated in main application. But not for nested itemRenderers.
 See mxml below.
   var item:Object = 
 Button(event.currentTarget).getRepeaterItem();
   var index:int = taskList.getItemIndex(item);
   if(index != -1)
   {
   taskList.removeItemAt(index);
   taskList.addItemAt(item, 0);
   }
   }
 
 mx:ArrayCollection id=taskList
   mx:Object label=Word/
   mx:Object label=Media Player/
   mx:Object label=Contacts/
   mx:Object label=Apache Server/
   mx:Object label=Dictionary/
   mx:Object label=iTunes/
   mx:Object label=Solitaire/
   mx:Object label=Minesweeper/
   mx:Object label=Safari/
   mx:Object label=RSS Reader/
   /mx:ArrayCollection
 
 !--code for item renderers--
 mx:TileList dataProvider={taskList}
 mx:itemRenderer
   mx:Component
   mx:Button styleName=myButtonStyle
 click=parentDocument.button_ClickHandler(event);/
   /mx:Component
/mx:itemRenderer
   /mx:TileList
 
 I tried to trace and it seems the Buttons inside itemRenderer can
 access the dataProvider in the outer document. But getCurrentItem()
 breaks. So how do I get the current item from the currentTarget?





Re: [flexcoders] Re: Compressing messages/data: What binary/compression formats are workable in Flex?

2009-03-01 Thread David Adams
On Mon, Mar 2, 2009 at 2:34 AM, Amy amyblankens...@bellsouth.net wrote:

 Plain text. Long before the invention of XML, developers used csv
 or csv-like files to power their data-driven apps. You'll have to
 load the plain text into objects, but hopefully you don't have a
 constraint against that :o)

Thanks for the suggestion. Sure, I can do some kind of a plain-text format
-- Fixed-length (not likely)
-- Variable length with length bytes
-- Some kind of delimited system (csv or what have you)

Depending on the content,
-- Fixed length is a bad idea...but it's useful in other contexts.
(For example, if you have a 'natural index' that lets you calculate a
rows position - then you can grab a row out of a huge file with a
couple of reads... but that's not my problem.)

-- Variable-length with a length byte: This would add only one byte
per variable-length item, so it's about as efficient as I can get.

-- Delimited system: Not as efficient as the previous method, but
popular so easy to support in many ways.

What I'm compariing against are two things:
1) The naive 'stupid unreadable XML' format that lets me keep using
XML but reduces the message size a bit.
2) True compression/binary format.

The unreadable XML approach reduces message size by making element
names shorter and removing whitespace. For example, instead of

ResultSet
 Record
FirstNameBob/FirstName
/Record
/ResultSet

...you get something like this:

abcBob/c/b/a

This obviously throws away the advantages of XML as 'human readable
markup'...an advantage that is irrelevant in my case - I'm just trying
to send messages that are produced by one program and read by another
program - no humans involved.

What I'm really hoping for is real compression - as plain text or XML
tend to compress fairly dramatically. Either that, or some other
binary format this is not AMF and that is supported natively in Flash.

Sorry for the length of my answer...I just suck at writing short
messages when I'm sorting through a problem. And, again, thanks for
the help.


[flexcoders] static function and getDefinitionByName

2009-03-01 Thread Sefi Ninio
Hi.

I am using getDefinitionByName from flash.utils to get a class definition /
instance from a string:
var ClassRef:Class = getDefinitionByName(className) as Class;

That works great, I can create an instance if I want.
Problem is, I need to call a static function on that ClassRef class, and
I'll know the function name only at runtime from XML.
Any idea on how to do this?


RE: [flexcoders] How to set VBox width to a %age in actionscript

2009-03-01 Thread Tracy Spratt
percentWidth = 100;

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of elevight
Sent: Sunday, March 01, 2009 12:37 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to set VBox width to a %age in actionscript

 

This is actually my second time to post this question. No one replied 
before, so maybe it got lost in the shuffle.

In MXML, I'd set the VBox width to 100% like this:

mx:VBox width=100%/

But in actionscript:

var vbox:VBox = new VBox();
vbox.width = 100%;

The above won't work because the compiler will flag an error 
on 100%. Does anyone know how I can set a VBox's width as a 
percentage in actionscript?

Thanks.





RE: [flexcoders] redundancy in custom ItemRenderer

2009-03-01 Thread Tracy Spratt
Why do you think the renderer's commitProperties is being called more than
once for a single item?  Your trace statements do not identify the item.
You understand that there is no direct relationship between the number of
items and the number of renderer instances?  The number of instances depends
on the number of visible rows, plus a few for buffering.

 

And are you just curious?  The specific renderer instantiation behavior is
normally not of concern to a developer, but  such concern sometimes
indicates misuse.

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of flexrookie
Sent: Saturday, February 28, 2009 9:35 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] redundancy in custom ItemRenderer

 

another question about ItemRenderers, using my previous stock example.

i have noticed that my custom item renderer seems to be performing
redundant executions. for a single dataProvider item, i see two
renderer instances created. and for each instance, set data and
commitProperties() are called repeatedly. 

here's my code:

StockApp.mxml
===
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml
com/2006/mxml
layout=absolute
applicationComplete=applicationCompleteListener(event)
mx:Script
![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.HorizontalList;
import mx.events.FlexEvent;
import mx.core.ClassFactory;

protected var list:HorizontalList;
protected var provider:ArrayCollection;

protected function applicationCompleteListener (e:FlexEvent):void {
// Provider
provider = new ArrayCollection();
provider.addItem({stockInfo:new StockInfo()});

// UI
list = new HorizontalList();
list.width = 400;
list.height = 100;
list.dataProvider = provider;
list.itemRenderer = new ClassFactory(StockInfoRenderer);

addChild(list);
} 
]]
/mx:Script
/mx:Application
===

StockInfoRenderer.as
===
package {
import mx.containers.Canvas;
import mx.controls.Button;

public class StockInfoRenderer extends Canvas {
protected var button:Button;

public function StockInfoRenderer () {
trace(StockInfoRenderer CONSTRUCTOR CALLED.);
}

override protected function createChildren ():void {
trace(StockInfoRenderer CREATE CHILDREN CALLED.);
super.createChildren();

if (button == null) {
button = new Button();
button.width = 100;
}
addChild(button);
}

override protected function commitProperties ():void {
trace(StockInfoRenderer COMMIT PROPERTIES CALLED.);
super.commitProperties();

button.label = data.stockInfo.getPrice();
}

override public function set data (value:Object):void {
trace(StockInfoRenderer SET DATA CALLED.);
super.data = value;
invalidateProperties()
}
}
}
===

OUTPUT:
===
StockInfoRenderer CONSTRUCTOR CALLED.
StockInfoRenderer CREATE CHILDREN CALLED.
StockInfoRenderer SET DATA CALLED.
StockInfoRenderer COMMIT PROPERTIES CALLED.
StockInfoRenderer SET DATA CALLED.
StockInfoRenderer COMMIT PROPERTIES CALLED.

StockInfoRenderer CONSTRUCTOR CALLED.
StockInfoRenderer SET DATA CALLED.
StockInfoRenderer CREATE CHILDREN CALLED.
StockInfoRenderer COMMIT PROPERTIES CALLED.
===

is the preceding redundancy typical, or am i doing something wrong?

~flashrookie





RE: [flexcoders] Re: Sending POST requests to php script??Help

2009-03-01 Thread Tracy Spratt
Yes, building the request object declaratively and binding in the values is
very hard to debug.

Build the request object in AS, so you can inspect the values you are
sending.  You also will not need to depend on bindable properties.

Tracy

-Original Message-
From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Jim Hayes
Sent: Sunday, March 01, 2009 1:51 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Sending POST requests to php script??Help

Well, I believe the syntax is correct, at least!
The warnings are telling you something, in a way, which is that unless your
objects properties are bindable flex won't be able to detect changes in them
at runtime.
Hence it won't work if as you might expect you want to specify the request
in mxml like that. 
It's just the way flex works, I found it a little hard to get used to at
first.
You might have better results if you call an actionscript function to set
the request object instead.


-Original Message-
From: flexcoders@yahoogroups.com on behalf of fprihoda
Sent: Sun 01/03/2009 12:51
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Sending POST requests to php script??Help
 
This doe not work, as I am not trying to make the object bindable.  I
am simply trying to reference the object values and pass them as part
of the HTTPService request.

--- In flexcoders@yahoogroups.com, Jim Hayes j...@... wrote:

 I'm making a wild guess here, but does this work?
 
 mx:request xmlns=
 first{modelName.name.first}/first
 last{modelName.name.last}/last
 email{modelName.email}/email
 /mx:request
 
 Apologies if not, I've not made any attempt to see if it does so it
could be utter rubbish.
 
 
 -Original Message-
 From: flexcoders@yahoogroups.com on behalf of fprihoda
 Sent: Sat 28/02/2009 19:09
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Sending POST requests to php script??Help
  
 The following code is not working as I would expect it to.
 
 mx:HTTPService id=srv2 url=http://localhost/flex_web/addform.php;
 resultFormat=object showBusyCursor=true
 result=resultHandler(event) method=POST
 mx:request xmlns=
 firstmodelName.name.first/first
 lastmodelName.name.last/last
 emailmodelName.email/email
 /mx:request
 /mx:HTTPService
 
 modelName is an object. I would like to send the POST variables to the
 php script using dot notation as shown above. The problem I am having
 is that it sends the entire string modelName.xxx.xxx instead of the
 actual object field.  I think this is a dereferencing issue, but I do
 not know how to fix it.
 
 Can someone help?
 
 
 
 __
 This communication is from Primal Pictures Ltd., a company
registered in England and Wales with registration No. 02622298 and
registered office: 4th Floor, Tennyson House, 159-165 Great Portland
Street, London, W1W 5PA, UK. VAT registration No. 648874577.
 
 This e-mail is confidential and may be privileged. It may be read,
copied and used only by the intended recipient. If you have received
it in error, please contact the sender immediately by return e-mail or
by telephoning +44(0)20 7637 1010. Please then delete the e-mail and
do not disclose its contents to any person.
 This email has been scanned for Primal Pictures by the MessageLabs
Email Security System.
 __




__
This communication is from Primal Pictures Ltd., a company registered in
England and Wales with registration No. 02622298 and registered office: 4th
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK.
VAT registration No. 648874577.


This e-mail is confidential and may be privileged. It may be read, copied
and used only by the intended recipient. If you have received it in error,
please contact the sender immediately by return e-mail or by telephoning
+44(0)20 7637 1010. Please then delete the e-mail and do not disclose its
contents to any person.
This email has been scanned for Primal Pictures by the MessageLabs Email
Security System.
__



RE: [flexcoders] updating an item renderer

2009-03-01 Thread Tracy Spratt
The core concepts are that item renderers need to update their visual UI
elements when the associated item changes, and need to update that item on
user interaction.

 

You assign a dataProvider(StockInfo) to the List, which results in item
renderers being instantiated.  Note, do not use an Array as a dataProvider,
use ArrayCollection.

 

When the underlying item changes, the framework calls the renderer's set
data method(setter).  When any pending changes are done, the framework calls
commitProperties.

 

You need to use this mechanism because there is no assurance that there will
be an instance of any particular renderer to listen of an event.  Renderers
are recycled. Google that before you go any further.

 

Tracy

 

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of flexrookie
Sent: Saturday, February 28, 2009 8:59 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] updating an item renderer

 

hi list, first post...

i have an architectural question about datatproviders and
itemrenderers that i'll pose with a canonical example.

suppose i have an array of StockInfo objects that is populated by a
3rd party library. each StockInfo object dispatches UPDATE events when
a stock price changes. i want to render the prices in HorizontalList
with a custom renderer.

here's the general application shell:

=
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml
com/2006/mxml
layout=absolute
applicationComplete=applicationCompleteListener(event)
mx:Script
![CDATA[
import mx.controls.HorizontalList;
import mx.events.FlexEvent;
import mx.core.ClassFactory;

protected var list:HorizontalList;
protected var stocks:Array;

protected function applicationCompleteListener (e:FlexEvent):void {
// Stock data (hardcoded for the example)
stocks = [new StockInfo()];

// UI
list = new HorizontalList();
list.width = 400;
list.height = 100;
list.itemRenderer = new ClassFactory(StockInfoRenderer);
addChild(list);
} 
]]
/mx:Script
/mx:Application
=

i need to wire the stocks array to the list. of course, given that i
already have an array of StockInfo objects, it's tempting to make an
ArrayCollection wrapper that gives direct access to the StockInfo
objects. e.g.,

provider = new ArrayCollection();
provider.addItem({stockInfo:someStockInfoObject});

then the StockInfoRenderer could register for UPDATE events and redraw
when the event occurs. but i'm hesitant about that approach. if i went
that route,

1) within the StockInfoRenderer, where would i register for the UPDATE
event? in commitProperties()?
2) within the StockInfoRenderer, where would i *remove* the UPDATE
listener?
3) given that renderers are reused, are there issues with synching, or
with stranded listeners causing memory build-up?

more generally, what's the right way to wire my list to the stocks
array? it feels like i might be forced to handle UPDATE for each
StockInfo object, and write a 'price' variable into a data provider.
e.g., 

provider.getItemAt(i).price = value;
provider.itemUpdated(provider.getItemAt(i), price);

seems a shame, given that i already have an array of StockInfo
objects. the above two lines presuppose that i'm going to hunt for the
item index every time a stock price changes. : (

another general question, do i even need the itemUpdate() call, or is
that part automated?

thanks for any advice!

flexrookie





[flexcoders] Re: redundancy in custom ItemRenderer

2009-03-01 Thread Amy
--- In flexcoders@yahoogroups.com, flexrookie flexroo...@... wrote:

 another question about ItemRenderers, using my previous stock example.
 
 i have noticed that my custom item renderer seems to be performing
 redundant executions. for a single dataProvider item, i see two
 renderer instances created. and for each instance, set data and
 commitProperties() are called repeatedly. 

http://flexdiary.blogspot.com/2008/04/is-horizontallist-faster-than-
hbox-with.html



[flexcoders] Re: updating an item renderer

2009-03-01 Thread Amy
--- In flexcoders@yahoogroups.com, Tracy Spratt tspr...@... wrote:

 The core concepts are that item renderers need to update their 
visual UI
 elements when the associated item changes, and need to update that 
item on
 user interaction.
 
  
 
 You assign a dataProvider(StockInfo) to the List, which results in 
item
 renderers being instantiated.  Note, do not use an Array as a 
dataProvider,
 use ArrayCollection.
 
  
 
 When the underlying item changes, the framework calls the 
renderer's set
 data method(setter).  When any pending changes are done, the 
framework calls
 commitProperties.

Well, sort of.  If a property of an object that's stored in an 
ArrayCollection changes, the ArrayCollection has no idea, and hence 
the List will not call setData().

You could potentially set up your itemRenderers to 
register/unregister for these events in the set data() override for 
your renderer.  But that means your renderer can only ever be used to 
render this type of object.  That's not necessarily a bad thing, but 
I try to keep my renderers barefoot and pregnant if you know what I 
mean.

So my approach would be to have a manager that contains an 
ArrayCollection of StockInfo objects as one of its public 
properties.  Bind the dataProvider on your HorizontalList to that 
public property.  

I'd probably limit that to read-only by just using a getter on it.  
Make sure your manager component takes care of all of the adding and 
deleting of StockInfos into the AC, so it can register for your 
change events on all items that are currently stored there and 
unregister for them once they're gone.  

Then when the manager gets the event, calls itemUpdated on whichever 
SockInfo changed, and the HorizontalList will update normally with no 
more special effort on your part.

HTH;

Amy



[flexcoders] Re: Flex receives generic Object types from Zend AMF

2009-03-01 Thread Amy
--- In flexcoders@yahoogroups.com, dejanstokanic 
dejanstoka...@... wrote:

 Hi Guys.
 I've got a strange problem with VO's in Flex.
 
 I've got my Flex set up correctly and AMF connection to PHP code 
with
 the help of Zend framework.
 
 Here's the problem:
 I've been sending VO's so far with no problem. PHP creates a new 
object
 e.g VOUser. Fills the data and returns the object as VOUser.
 Flex on the other side gets the response event (ResultEvent) and
 event.result type is VOUser.
 
 Then I've created a new VO - VOReport and PHP returns a new 
VOReport -
 I've tested this with Charles http://www.charlesproxy.com/  .
 But Flex receives a generic Object instead of VOReport.
 
 VOReport.as code :
  [RemoteClass(alias=VOReport)]
  [Bindable]
  public class VOReport
  {
  public var name:String;
  public var parentId:int;
  }
 
 VOReport.php
 ?php
 class VOReport {
 
  public $name;
  public $parentId;
 }
 
 index.php is ofcorse mapped.
 
 and a simple php function
  public function getReports()
  {
  $a = new VOReport();
  $a-name = Report 1;
  return $a;
  }
 
 I could typecast the object but the function will be designed to 
return
 diffrent object types...
 
 Help is appreciated :)

http://flexdiary.blogspot.com/2008/11/thoughts-on-remoting.html




[flexcoders] Re: Binding property of object in dataProvider

2009-03-01 Thread Amy
--- In flexcoders@yahoogroups.com, gwangdesign gwangdes...@... 
wrote:

 I am trying to bind a property (label) in my data object so that 
the
 changes on it can be propagated to all the views (The controls may
 want to edit this property). Currently I am wrapping them as plain
 objects in ArrayCollection and I got the following warning:
 
 warning: unable to bind to property 'label' on class 'Object' 
(class
 is not an IEventDispatcher)
 
 Does the compiler suggest making the Object a subclass of
 IEventDispatcher? How do I do it if so?
 
 My code is as below. Thanks!
 
 mx:ArrayCollection id=taskList
   mx:Object label=Word/
   mx:Object label=Media Player/
   mx:Object label=Contacts/
   mx:Object label=Apache Server/
   mx:Object label=Dictionary/
   mx:Object label=iTunes/
   mx:Object label=Solitaire/
   mx:Object label=Minesweeper/
   mx:Object label=Safari/
   mx:Object label=RSS Reader/
   /mx:ArrayCollection
   mx:VBox
   mx:Repeater id=myRP dataProvider={taskList} 
recycleChildren=true
   mx:Button horizontalCenter=0
 label={String(myRP.currentItem.label)}
 click=button_ClickHandler(event);/
   /mx:Repeater
   /mx:VBox

IEventDispatcher is not a Class, but an Interface. Maybe this will 
help:
http://flexdiary.blogspot.com/2008/11/implementing-
ieventdispatcher.html



[flexcoders] SWFLoader content-resizing problem

2009-03-01 Thread danieldudek86
Hi!

Firstly - sorry for my english, I'm not a native english speaker.
Secondly - sorry for a long post;) I'd like to show the problem clearly

I've got a problem with resizing swf applications loaded with
SWFLoader component. The problem is that it behaves differently when
the content-application is at the same domain (or locally) and at the
foreign domain. Here is the example applications, and some screenshots
showing the behavior:

exported base application:
http://www.sendspace.com/file/lk6ce6

first swf application written in flex:
http://www.sendspace.com/file/j4ooyo

second swf application written in flex:
http://www.sendspace.com/file/bcqxti

The first app, lets call it 'base application' is loading two
applications ('stiff size' with application size set to 640x480px, and
'resizable' with size set to 100%x100%, both with one button filling
all the application area) exported to swf files, with swf loaders; 

1.When swf's are loaded locally, or at the same domain:
a) 'resizable' app is resized to SWFLoader component size
b) 'stiff size' app is not resized at all
screenshot:
http://img8.imageshack.us/my.php?image=local.png

2.When swf's are loaded at the foreign domain (with
Security.allowDomain(domain address) at the base application
initialization):
a) 'resizable' app is about twice bigger as it should be! (the biggest
problem)
b) 'stiff size' app is stretched to SWFLoader component size
screenshot:
http://img213.imageshack.us/my.php?image=remote.png

The behavior that would be best for me is 1a for resizable
applications, and 2b for applications with defined size (eventually 1b
- not resized at all) for both local loading, and from foreign domain. 

1. Is it possible?
2. Is it the SWFLoader proper behavior, or is it a bug? I've found a bug
on adobe jira with similar problem, but with 'cannot reproduce'
status, and no workaround (the trustContent=true do not work for me),
should i post a comment there?
link to jira: http://bugs.adobe.com/jira/browse/SDK-13323

The swf files are uploaded for testing at the adresses:
http://tomekok.ovh.org/test/ResizableSWF.swf
http://tomekok.ovh.org/test/StiffSizeSWF.swf



Re: [flexcoders] Binding property of object in dataProvider

2009-03-01 Thread Garth Somerville
If the point of your question is that you are starting with anonymous objects, 
then wrapping each item with a mx.utils.ObjectProxy will do what you want by 
making each property of the proxied object bindable.

The other alternative is not to use an anonymous object, but to create a 
concrete class for the tasks:

class Task {
  [Bindable]  public var label:String;
}

Ultimately this way is better for several reasons. (Note that as shown the mxml 
compiler will have to rewrite the class to implement IEventDispatcher)


  

[flexcoders] Re: Sending POST requests to php script??Help

2009-03-01 Thread fprihoda
I CAN access the flex object at run-time.  And it need not be bindable.
For example:

Alert.show(modelName.name.first,title=modelName.name.first Value);

Correctly displays the modelName.name.first value.  However, when I
access the same object in the HTTPService request, I can not access
the objects value.  I don't know what the problem is.

This problem is driving me nuts.

Frank



RE: [flexcoders] Re: Sending POST requests to php script??Help

2009-03-01 Thread Tracy Spratt
But you are using Object, and Object is not bindable and you are trying to
bind:

first{modelName.name.first}/first

The braces mean binding.

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of fprihoda
Sent: Sunday, March 01, 2009 7:09 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Sending POST requests to php script??Help

 

I CAN access the flex object at run-time. And it need not be bindable.
For example:

Alert.show(modelName.name.first,title=modelName.name.first Value);

Correctly displays the modelName.name.first value. However, when I
access the same object in the HTTPService request, I can not access
the objects value. I don't know what the problem is.

This problem is driving me nuts.

Frank





Re: [flexcoders] Re: Getting ByteArray.uncompress() to work in Flash - looking for an example text with compressed bytes

2009-03-01 Thread David Adams
On Sun, Mar 1, 2009 at 9:06 PM, Cato Paus ca...@brannsikring.no wrote:
 go here
 http://onrails.org/articles/2007/11/27/flash-utils-bytearray-compressing-4-1mb-to-20k

Thanks for the link! I couldn't get the AIR app to compile, but
realized it pointed out an obvious strategy: use Flash to
encode/decode the test string. I've got that going now so I can sort
out a byte comparison with my server-side encoder's.

I also found an old bug report that indicates that Flash only
understands 'zlib' and does not understand deflate, at the moment.
That's a bit of a help but 'zlib' covers a bit of ground, as far as I
can tell (?)

Thanks again.


[flexcoders] converting HierarchicalData type to Java

2009-03-01 Thread Monali Gandhi
Hi all,

How to read the children data from the ArrayCollection at the java end.
and also i want to send ArrayCollection from java to flex.


Thanks in advance,
Monali



  

RE: [flexcoders] SWFLoader content-resizing problem

2009-03-01 Thread Alex Harui
Which version of the SDK are you using?  3.2?

Alex Harui
Flex SDK Developer
Adobe Systems Inc.http://www.adobe.com/
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of danieldudek86
Sent: Sunday, March 01, 2009 12:08 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] SWFLoader content-resizing problem


Hi!

Firstly - sorry for my english, I'm not a native english speaker.
Secondly - sorry for a long post;) I'd like to show the problem clearly

I've got a problem with resizing swf applications loaded with
SWFLoader component. The problem is that it behaves differently when
the content-application is at the same domain (or locally) and at the
foreign domain. Here is the example applications, and some screenshots
showing the behavior:

exported base application:
http://www.sendspace.com/file/lk6ce6

first swf application written in flex:
http://www.sendspace.com/file/j4ooyo

second swf application written in flex:
http://www.sendspace.com/file/bcqxti

The first app, lets call it 'base application' is loading two
applications ('stiff size' with application size set to 640x480px, and
'resizable' with size set to 100%x100%, both with one button filling
all the application area) exported to swf files, with swf loaders;

1.When swf's are loaded locally, or at the same domain:
a) 'resizable' app is resized to SWFLoader component size
b) 'stiff size' app is not resized at all
screenshot:
http://img8.imageshack.us/my.php?image=local.png

2.When swf's are loaded at the foreign domain (with
Security.allowDomain(domain address) at the base application
initialization):
a) 'resizable' app is about twice bigger as it should be! (the biggest
problem)
b) 'stiff size' app is stretched to SWFLoader component size
screenshot:
http://img213.imageshack.us/my.php?image=remote.png

The behavior that would be best for me is 1a for resizable
applications, and 2b for applications with defined size (eventually 1b
- not resized at all) for both local loading, and from foreign domain.

1. Is it possible?
2. Is it the SWFLoader proper behavior, or is it a bug? I've found a bug
on adobe jira with similar problem, but with 'cannot reproduce'
status, and no workaround (the trustContent=true do not work for me),
should i post a comment there?
link to jira: http://bugs.adobe.com/jira/browse/SDK-13323

The swf files are uploaded for testing at the adresses:
http://tomekok.ovh.org/test/ResizableSWF.swf
http://tomekok.ovh.org/test/StiffSizeSWF.swf



[flexcoders] Re: Getting ByteArray.uncompress() to work in Flash - looking for an example tex

2009-03-01 Thread Bjorn Schultheiss
ASCompress supports GZIP
http://code.google.com/p/ascompress/

--- In flexcoders@yahoogroups.com, David Adams dpad...@... wrote:

 On Sun, Mar 1, 2009 at 9:06 PM, Cato Paus ca...@... wrote:
  go here
  http://onrails.org/articles/2007/11/27/flash-utils-bytearray-compressing-4-1mb-
to-20k
 
 Thanks for the link! I couldn't get the AIR app to compile, but
 realized it pointed out an obvious strategy: use Flash to
 encode/decode the test string. I've got that going now so I can sort
 out a byte comparison with my server-side encoder's.
 
 I also found an old bug report that indicates that Flash only
 understands 'zlib' and does not understand deflate, at the moment.
 That's a bit of a help but 'zlib' covers a bit of ground, as far as I
 can tell (?)
 
 Thanks again.





RE: [flexcoders] static function and getDefinitionByName

2009-03-01 Thread Alex Harui
ClassRef[“staticFunctionName”]()

Alex Harui
Flex SDK Developer
Adobe Systems Inc.http://www.adobe.com/
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Sefi Ninio
Sent: Sunday, March 01, 2009 2:07 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] static function and getDefinitionByName

Hi.

I am using getDefinitionByName from flash.utils to get a class definition / 
instance from a string:
var ClassRef:Class = getDefinitionByName(className) as Class;

That works great, I can create an instance if I want.
Problem is, I need to call a static function on that ClassRef class, and I'll 
know the function name only at runtime from XML.
Any idea on how to do this?



RE: [flexcoders] Re: Image scaleContent=false causes Security Sandbox Violation in AIR 1.5.x

2009-03-01 Thread Alex Harui
Tell them to ignore it because I said so :)

Alex Harui
Flex SDK Developer
Adobe Systems Inc.http://www.adobe.com/
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Shigeru Nakagaki
Sent: Sunday, March 01, 2009 2:21 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Image scaleContent=false causes Security Sandbox 
Violation in AIR 1.5.x


I'm a freelance and some of my customers use FlexBuilder to customize
app which I made :(

When they see Security Sandbox Violation in console, it's so hard to
explain.

# Especially the Japanese really minds about these tiny things.



RE: [flexcoders] Set the FrameRate

2009-03-01 Thread Alex Harui
It uses the main SWFs framerate.  See 
http://livedocs.adobe.com/flex/3/langref/flash/display/LoaderInfo.html#frameRate

Alex Harui
Flex SDK Developer
Adobe Systems Inc.http://www.adobe.com/
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of christophe_jacquelin
Sent: Sunday, March 01, 2009 1:46 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Set the FrameRate


Hello,

How to set the FrameRate of a .SWF file opened with SWFLoader ?

Thank you,
Christophe,