[flexcoders] Re: Strange and Frustrating amfPHP behaviour Unsupported Datatype: array

2010-06-17 Thread ouaqa
In the end I found my solution.
It just so happens that my value objects were incorrectly formed on the server 
side. Hence, some properties were as arrays where the flex was expecting value 
objects.

It took me a while to find out since the incorrect objects where deeply buried 
in the object hierarchy but thanks to charles and the magic instruction return 
(print_r($someObject, true)); I got everything working again. 

--- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote:

 I return arrays of objects (Or just single objects) all the time although I 
 use WebORB instead of PHP.
 
 What does Charles (http://www.charlesproxy.com) say? What does the PHP error 
 log show?
 
 --- In flexcoders@yahoogroups.com, ouaqa abenefice@ wrote:
 
  Hello all,
  
  I've been stuck for a couple of days with a very weird error provoked by
  AMFPhp.
  
  My Flex client sends to the server a fairly complex value object.
  This object is composed of basic attributes (string , int , ...) , value
  object attributes and an array of value objects (also complex objects
  ).
  
  I can perform any treatment on this object on the php side.
  However, when I want to send the value object back, I get an
  Unsupported Datatype: array error.
  
  In order to simplify my explanations, let's say that this variable is
  called $array.
  
  I tested the following :
  
  - gettype($array) returns array.
  
  - I can return any properties of my array, either by $array[someIndex]
  (returning the value object held at someIndex) or by
  $array[someIndex][someValueObjectAttribute]
  
  - I can use print_r and see the content of $array.
  
  -  I can create an array on the server side and return it (even if it
  contains value objects).
  
  I just tested to copy each value of $array in a temporary variable and
  return it to the server but nothing different happened.
  
  Any help would be appreciated, this is getting very very frustrating.
 





[flexcoders] Strange and Frustrating amfPHP behaviour Unsupported Datatype: array

2010-06-10 Thread ouaqa
Hello all,

I've been stuck for a couple of days with a very weird error provoked by
AMFPhp.

My Flex client sends to the server a fairly complex value object.
This object is composed of basic attributes (string , int , ...) , value
object attributes and an array of value objects (also complex objects
).

I can perform any treatment on this object on the php side.
However, when I want to send the value object back, I get an
Unsupported Datatype: array error.

In order to simplify my explanations, let's say that this variable is
called $array.

I tested the following :

- gettype($array) returns array.

- I can return any properties of my array, either by $array[someIndex]
(returning the value object held at someIndex) or by
$array[someIndex][someValueObjectAttribute]

- I can use print_r and see the content of $array.

-  I can create an array on the server side and return it (even if it
contains value objects).

I just tested to copy each value of $array in a temporary variable and
return it to the server but nothing different happened.

Any help would be appreciated, this is getting very very frustrating.



[flexcoders] Re: embed images dynamically

2010-05-21 Thread ouaqa
Hello,

you could load images dynamically from a given url.

what you need to do is make a new url request and use a loader :

public function setImage (AnImageSource : String) : void
{
var request:URLRequest = new URLRequest(AnImageSource);
var imageLoader:Loader = new Loader();

imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, 
onFrameReceptionComplete);
imageLoader.load(request);
}

then on reception complete :
private function onFrameReceptionComplete (event : Event) : void
{   
originalFrameBitmap = Bitmap(event.currentTarget.content) ; 
this.addFrame() ;   
}

Now you have a Bitmap object containing your image. 

Remember that the flash player needs an authorization to access stuff at 
addresses different than his address, so you'll have to add a xml configuration 
file called crossdomain.xml at the root of your image folder.

Good luck
--- In flexcoders@yahoogroups.com, sony antony pow_like_me...@... wrote:

 Hi friends,
 
 Is there any way that we can embed an image dynamically through action 
 script??
 
 If I do, it as given below,
 
 [Embed (source='../assets/image/icon.jpg')]
 public var myImage:Class;
 
 myButton.setStyle(backgroundImage,myImage);
 
 
 It works fine..
 
 But this button is created dynamically, and there are number of buttons 
 created in one container. 
 This button is a custom class too.. and I need different images to each 
 button, that is what my requirement is.. 
 
 any suggestion from any of you friends..??
 
 Thanks and Regards,
 Sony.





[flexcoders] Re: var myVar : Function = new Function ? examples?

2010-05-21 Thread ouaqa
If it may help, this is how I usually manage my remote connections.
Before you say it's off-topic, I think it might answer your question :


public class LCRemoteConnectionManager
{

private static var serverRemoteObject : RemoteObject ; // = null


private var onGetCelluleFormatListResultFunction : Function ;
private var onGetCelluleFormatListResultFaultFunction : Function ;


/*
 some irrelevant stuff
*/

public function getCellulesFormats (AGetFormatListResultFunction : Function 
,AGetFormatListResultFaultFunction : Function ) : void
{
if (serverRemoteObject === null)
{ this.createServerRemoteObject() ; }

this.onGetCelluleFormatListResultFaultFunction = 
AGetFormatListResultFaultFunction ;
this.onGetCelluleFormatListResultFunction = 
AGetFormatListResultFunction ; 

serverRemoteObject.getCellulesFormats();
}

private function getCellulesFormatsResult (AEvent : ResultEvent):void
{
if (this.onGetCelluleFormatListResultFunction != null)
{ this.onGetCelluleFormatListResultFunction(AEvent) ; }
else
{ Alert.show(LCRemoteConnectionManager : getCellulesFormatsResult : 
onGetFormatListResultFunction is null) ; }
}


So I assign myFunction variables like any others (myFunction = someFunction )
and then, I call it like any other. The only problem is that I need to know how 
to use someFunction when calling myFunction.

good luck
 
--- In flexcoders@yahoogroups.com, Nick Middleweek n...@... wrote:

 Hello,
 
 I can't find any examples on how to create Functon variables?
 
 Does anyone have any to hand please?
 
 
 Thanks,
 Nick
 
 
 -- 
 Sent by Nick Middleweek ( { email: n...@..., blog:
 http://blog.middleweek.co.uk } );





[flexcoders] Re: creating a magnetic grid

2010-05-21 Thread ouaqa
Thanks a lot, I'm gonna look into it

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

 You might be able to use this:
 
 http://blogs.adobe.com/aharui/2010/01/constrained_drag_and_drop.html
 
 
 On 5/20/10 5:50 AM, ouaqa abenef...@... wrote:
 
 
 
 
 
 
 Hello,
 
 As part of my project, I need to create a magnetic grid, locking moving 
 objects to the grid as they are moved (it's a drawing api).
 
 The Graphic Objects (i.e pictures, text, ... ) are Canvas objects that are 
 display on a Canvas (more or less the background of the drawing api).
 
 Over this canvas, i added another canvas displaying a grid ( a Shape Object 
 with a bunch of horizontal and vertical lines).
 
 This is where my imagination stops.
 I'm fairly new to flex development and I have no idea about how to lock the 
 graphic objects to the grid as they are moved.
 
 By the way, if it's relevant to you guys, objects are not moved using the 
 dragdrop mechanism but using the com.greensock.transformManager 
 (http://www.greensock.com/).
 
 I've searched the adobe documentation, this group and googled for a while 
 without finding any relevant information. Any advice would be greatly 
 appreciated.
 If any of you wish, I can add some juicy bits of code.
 
 Thanks in advance.
 
 
 
 
 
 
 --
 Alex Harui
 Flex SDK Team
 Adobe System, Inc.
 http://blogs.adobe.com/aharui





[flexcoders] Re: Embed source path issue

2010-05-21 Thread ouaqa
Hello,

try removing the / in before com. =  
[Embed(source=com/domain/assets/images/sm_minus_ro.png)]

I think this is the problem.

--- In flexcoders@yahoogroups.com, method_air loudj...@... wrote:

 I'm trying to 'embed source' a .png located in an graphics rsl from a flex 
 project (the rsl is in the project build path).
 
 Flex is throwing an error 'unable to resolve 'image path' for transcoding.
 
 The package structure of the graphics rsl is:
 
 src/com/domain/assets/images/image.png
 
 This fails:
 
[Embed(source=/com/domain/assets/images/sm_minus_ro.png)]
 
 What path will work?
 
 Thanks,
 
 Philip





[flexcoders] Re: creating a magnetic grid

2010-05-21 Thread ouaqa
Hello again, 
I solved this issue by creating a MagneticGrid object containing the visual 
representation of the grid and two arrays : one for x-axis grid coordinates , 
the other for the y-axis coordinates.

When an item is moved, it's current position is tested against the two arrays.
If the current position is close enough to a magnetic axis point, it is 
directly moved to the corresponding coordinate.

--- In flexcoders@yahoogroups.com, ouaqa abenef...@... wrote:

 Thanks a lot, I'm gonna look into it
 
 --- In flexcoders@yahoogroups.com, Alex Harui aharui@ wrote:
 
  You might be able to use this:
  
  http://blogs.adobe.com/aharui/2010/01/constrained_drag_and_drop.html
  
  
  On 5/20/10 5:50 AM, ouaqa abenefice@ wrote:
  
  
  
  
  
  
  Hello,
  
  As part of my project, I need to create a magnetic grid, locking moving 
  objects to the grid as they are moved (it's a drawing api).
  
  The Graphic Objects (i.e pictures, text, ... ) are Canvas objects that are 
  display on a Canvas (more or less the background of the drawing api).
  
  Over this canvas, i added another canvas displaying a grid ( a Shape Object 
  with a bunch of horizontal and vertical lines).
  
  This is where my imagination stops.
  I'm fairly new to flex development and I have no idea about how to lock 
  the graphic objects to the grid as they are moved.
  
  By the way, if it's relevant to you guys, objects are not moved using the 
  dragdrop mechanism but using the com.greensock.transformManager 
  (http://www.greensock.com/).
  
  I've searched the adobe documentation, this group and googled for a while 
  without finding any relevant information. Any advice would be greatly 
  appreciated.
  If any of you wish, I can add some juicy bits of code.
  
  Thanks in advance.
  
  
  
  
  
  
  --
  Alex Harui
  Flex SDK Team
  Adobe System, Inc.
  http://blogs.adobe.com/aharui
 





[flexcoders] creating a magnetic grid

2010-05-20 Thread ouaqa
Hello,

As part of my project, I need to create a magnetic grid, locking moving objects 
to the grid as they are moved (it's a drawing api).

The Graphic Objects (i.e pictures, text, ... ) are Canvas objects that are 
display on a Canvas (more or less the background of the drawing api).

Over this canvas, i added another canvas displaying a grid ( a Shape Object 
with a bunch of horizontal and vertical lines).

This is where my imagination stops.
I'm fairly new to flex development and I have no idea about how to lock the 
graphic objects to the grid as they are moved.

By the way, if it's relevant to you guys, objects are not moved using the 
dragdrop mechanism but using the com.greensock.transformManager 
(http://www.greensock.com/).

I've searched the adobe documentation, this group and googled for a while 
without finding any relevant information. Any advice would be greatly 
appreciated. 
If any of you wish, I can add some juicy bits of code.

Thanks in advance.



[flexcoders] Re: adding transparent images to a canvas

2010-05-18 Thread ouaqa
Yes,  removed those bits of code in the new BitmapData Calls. It was a 
desperate try to obtain a satisfying result.
It didn't change anything to my problem in good or bad so I removed them, but 
only after posting my problem. 
I'm still wondering how my transparent png images becomes opaque when handled 
in flex.




[flexcoders] adding transparent images to a canvas

2010-05-17 Thread ouaqa
good morning fellow flexers. 

I've been struggling for the last 3 days with a very frustrating problem.

In a photo manipulation project, I use a canvas where I handle images.
So, an image is displayed in a canvas and I want to add a new image on top of 
it, let's say a cool wood-looking frame. The first image is a jpg embedded but 
the second image, the frame, is a transparent 32bits png file loaded on demand.
The png file is transparent, as far as I can tell in photoshop. Yet, when I 
load it, all the transparent bits appear white.

This problem is making me crazy and I don't know how to handle it. Any help 
would be appreciated.

Bellow are parts of my code :

In the canvas handling the images : 


-loading the image 
public function setImageFrame (AnImageSource : String) : void
{

var request:URLRequest = new URLRequest(AnImageSource);
frameImage = new Image() ;
frameImage.addEventListener(Event.COMPLETE, onFrameReceptionComplete) ;

frameImage.load(AnImageSource);

}

- Adding the loaded image to the canvas
private function onFrameReceptionComplete (event : Event) : void
{
var bounds : Rectangle = new Rectangle(0,0,this.width,this.height); 



var rawFrame : Bitmap = Bitmap(frameImage.content );
var rawBitmapDataFrame : BitmapData = new BitmapData (rawFrame.width , 
rawFrame.height , true,0x) ;
rawBitmapDataFrame.draw(rawFrame) ;

//display true
trace (rawBitmapDataFrame.transparent); 
rawFrame = new Bitmap(rawBitmapDataFrame) ;


frameImage.source = LCUtilTools.cropAndResizeImage(rawFrame , bounds);

//display true
trace (Bitmap(frameImage.source).bitmapData.transparent); 
 
frameImage.smoothBitmapContent = true;

this.addChild(frameImage);
}


the cropAndResize function (used to resize the image to the correct ratio.

public static function cropAndResizeImage (AnImage : Bitmap , ABounds : 
Rectangle) : Bitmap
{

var celluleRawBitmap : BitmapData = AnImage.bitmapData  

var originalWidth:Number = celluleRawBitmap.width;
var originalHeight:Number = celluleRawBitmap.height;
var newWidth:Number = originalWidth;
var newHeight:Number = originalHeight;


var scale : Number ;
var m:Matrix = new Matrix();

var scaleX:Number = 1;
var scaleY:Number = 1;
if (originalWidth  ABounds.width || originalHeight  ABounds.height)
{
scaleX =  ABounds.width / celluleRawBitmap.width;
scaleY = ABounds.height / celluleRawBitmap.height;
scale = Math.max(scaleX, scaleY);
newWidth = originalWidth * scale;
newHeight = originalHeight * scale; 
}

m.scale(scale,scale);

var zoomArea : Rectangle ;
zoomArea = celluleRawBitmap.rect ;
zoomArea.inflate(ABounds.width , ABounds.height);
var editedBitmapData : BitmapData = new BitmapData (ABounds.width , 
ABounds.height , true ,0x00FF);
editedBitmapData.draw(AnImage.bitmapData,m);

return ( new Bitmap(editedBitmapData));
}

Any help would be really appreciated, I really don't know what to do or where 
to begin in order to solve this issue.



[flexcoders] Re: adding transparent images to a canvas

2010-05-17 Thread ouaqa
using the getPixel() and SetPixel32() methods, I managed to handle the 
transparency but this solution isn't pretty at all. The initial image is still 
supposed to be transparent.
Here is the bit of code that sets the transparent pixels.
(It's in the onFrameReceptionComplete function)

Bitmap(frameImage.source).bitmapData.lock();
for (cptX = 0 ; cptX  maxX ; cptX ++)
{

for (cptY = 0 ; cptY  maxY ; cptY ++)
{
if (Bitmap(frameImage.source).bitmapData.getPixel(cptX , cptY) 
== 0xF5FBFB)
{ Bitmap(frameImage.source).bitmapData.setPixel32(cptX,cptY, 
0x) }
}
}
Bitmap(frameImage.source).bitmapData.unlock();

For the sake of the holy deadline integrity, I applied this hack in order to 
keep going but I'm sure there is a better way to answer this problem. 
Any suggestion would be greatly appreciated.
cheers

--- In flexcoders@yahoogroups.com, ouaqa abenef...@... wrote:

 good morning fellow flexers. 
 
 I've been struggling for the last 3 days with a very frustrating problem.
 
 In a photo manipulation project, I use a canvas where I handle images.
 So, an image is displayed in a canvas and I want to add a new image on top of 
 it, let's say a cool wood-looking frame. The first image is a jpg embedded 
 but the second image, the frame, is a transparent 32bits png file loaded on 
 demand.
 The png file is transparent, as far as I can tell in photoshop. Yet, when I 
 load it, all the transparent bits appear white.
 
 This problem is making me crazy and I don't know how to handle it. Any help 
 would be appreciated.
 
 Bellow are parts of my code :
 
 In the canvas handling the images : 
 
 
 -loading the image 
 public function setImageFrame (AnImageSource : String) : void
 {
 
   var request:URLRequest = new URLRequest(AnImageSource);
   frameImage = new Image() ;
   frameImage.addEventListener(Event.COMPLETE, onFrameReceptionComplete) ;
   
   frameImage.load(AnImageSource);
 
 }
 
 - Adding the loaded image to the canvas
 private function onFrameReceptionComplete (event : Event) : void
 {
   var bounds : Rectangle = new Rectangle(0,0,this.width,this.height); 
 
   
 
   var rawFrame : Bitmap = Bitmap(frameImage.content );
   var rawBitmapDataFrame : BitmapData = new BitmapData (rawFrame.width , 
 rawFrame.height , true,0x) ;
   rawBitmapDataFrame.draw(rawFrame) ;
 
 //display true
   trace (rawBitmapDataFrame.transparent); 
   rawFrame = new Bitmap(rawBitmapDataFrame) ;
 
 
   frameImage.source = LCUtilTools.cropAndResizeImage(rawFrame , bounds);
   
 //display true
   trace (Bitmap(frameImage.source).bitmapData.transparent); 

   frameImage.smoothBitmapContent = true;
 
   this.addChild(frameImage);
 }
 
 
 the cropAndResize function (used to resize the image to the correct ratio.
 
 public static function cropAndResizeImage (AnImage : Bitmap , ABounds : 
 Rectangle) : Bitmap
 {
 
   var celluleRawBitmap : BitmapData = AnImage.bitmapData  
   
   var originalWidth:Number = celluleRawBitmap.width;
   var originalHeight:Number = celluleRawBitmap.height;
   var newWidth:Number = originalWidth;
   var newHeight:Number = originalHeight;
   
   
   var scale : Number ;
   var m:Matrix = new Matrix();
   
   var scaleX:Number = 1;
   var scaleY:Number = 1;
   if (originalWidth  ABounds.width || originalHeight  ABounds.height)
   {
   scaleX =  ABounds.width / celluleRawBitmap.width;
   scaleY = ABounds.height / celluleRawBitmap.height;
   scale = Math.max(scaleX, scaleY);
   newWidth = originalWidth * scale;
   newHeight = originalHeight * scale; 
   }
   
   m.scale(scale,scale);
   
   var zoomArea : Rectangle ;
   zoomArea = celluleRawBitmap.rect ;
   zoomArea.inflate(ABounds.width , ABounds.height);
   var editedBitmapData : BitmapData = new BitmapData (ABounds.width , 
 ABounds.height , true ,0x00FF);
   editedBitmapData.draw(AnImage.bitmapData,m);
 
   return ( new Bitmap(editedBitmapData));
 }
 
 Any help would be really appreciated, I really don't know what to do or where 
 to begin in order to solve this issue.





[flexcoders] vertical display of text

2010-05-06 Thread ouaqa
Hello, 
As the topic says, I'm trying to display a TextField element vertically like 
this :
s
o
m
e

t
e
x
t

Part of the rendering is performed using a textformat object.
After reading the specs of both classes (textfield  textformat) and googling 
for answers, I didn't find anything.
Any help would be appreciated 



[flexcoders] application preload and amf calls

2010-05-05 Thread ouaqa
Hello fellow flex coders.

In the current application that I'm working on, I have to display on the login 
window a list obtained through an AMF call to the server. 

My problem is that I don't know how to freeze the loading of my application 
until the response from the AMF call is obtained. 

Any suggestion would be appreciated.

Thanks in advance,
ouaqa



[flexcoders] Re: Is there a tool to detect whether the loaded swf is from browser's cache?

2010-04-23 Thread ouaqa
Hello,

As far as I know, there is no way to know this. But again, I'm not an expert.

When changing our version of the swf, we append it's new version number. This 
way, we're sure the user is using ourApp-vLastVersion.swf and not 
ourApp-vOldAndBuggedVersion.swf, the versions being based on the 
corresponding svn revision number . 
Unfortunately, I don't remember how to do that.

--- In flexcoders@yahoogroups.com, handitan handi@... wrote:

 Hi all,
 
 I am just wondering if there's a tool to detect whether the loaded swf is 
 from browser's cache or not?
 
 Appreciate it.
 
 Thx!





[flexcoders] applying styles to UITextfield, embeding fonts and more fun stuff

2010-04-09 Thread ouaqa
Hello fellow flexcoders.
I'm stuck at a critical point while developing my application.
Here's the context :

A user can add and style text to a postcard (being a Canvas).
The text can then be modified and rotated.
The rotation is handled by a library performing well on pictures.

The text is a UITextField object, the style is a TextFormat Object.
Both are handled in a global container (extending the Canvas class).

The fonts are embedded in a font library.

On creation, it seems that the font is not loaded (the text is still shown with 
the usual boring police). Therefore , the font is not embedded and rotation 
makes the text disappear.

I'm not sure what my problem exactly is, and this is why I'm calling for your 
help  knowledge.

bellow is the definition of the font library :

[Bindable]
public final class FontsLibrary
{
//  public static var fontLib : Array = new Array(); doesn't work

/**
 * The verdana font from the assets library
 */
[Embed(source=../assets/fonts/verdana.TTF , fontName=verdana , 
mimeType='application/x-font-truetype')]
public static var verdana:Class;

//assigning font to static attribute
//  public static var verdana : FontAsset = new LCVerdana ();
//  fontLib.push (verdana) ;

.




Bellow is the constructor of my text element

public function LCTextElementField( AText : String =  , AColor : int = -1 , 
ASize : int = -1)
{
super();

var afont : Font = new FontsLibrary.RAVIE();

this.elementText = new UITextField();   
textFormat = new TextFormat();

if (AColor != -1)
{ this.textFormat.color = AColor ; }

if (ASize != -1)
{ this.textFormat.size = ASize ; }
else
{ this.textFormat.size = 30 ; }

this.textFormat.font = afont.fontName; 

this.elementText.defaultTextFormat = textFormat ;

this.elementText.embedFonts = true;
this.elementText.autoSize = TextFieldAutoSize.LEFT; 
this.elementText.antiAliasType = AntiAliasType.ADVANCED ;

if (AText ==  )
{ this.elementText.text = Lorem ipsum dolor sit amet; }
else
{ this.elementText.text = AText ; }

this.addChild(this.elementText);
}

As you can see the code is pretty basic. At the moment, I set the police to 
RAVIE, so I can notice rapidly if the changes have been set.

Any help, advice, anything would be of great use. I'm running short on ideas.



[flexcoders] Re: applying styles to UITextfield, embeding fonts and more fun stuff

2010-04-09 Thread ouaqa
problem solved using textfield and textformat objects. 

here are the modifications :

this.elementText = new TextField(); 
textFormat = new TextFormat();
...
...
var conteneur : UIComponent = new UIComponent();
conteneur.addChild(this.elementText);
this.addChild(conteneur);   

for the curious ones, a textfield must be added to a uicomponent before adding 
it to a canvas, as canvas only accept uicomponents.

--- In flexcoders@yahoogroups.com, ouaqa abenef...@... wrote:

 Hello fellow flexcoders.
 I'm stuck at a critical point while developing my application.
 Here's the context :
 
 A user can add and style text to a postcard (being a Canvas).
 The text can then be modified and rotated.
 The rotation is handled by a library performing well on pictures.
 
 The text is a UITextField object, the style is a TextFormat Object.
 Both are handled in a global container (extending the Canvas class).
 
 The fonts are embedded in a font library.
 
 On creation, it seems that the font is not loaded (the text is still shown 
 with the usual boring police). Therefore , the font is not embedded and 
 rotation makes the text disappear.
 
 I'm not sure what my problem exactly is, and this is why I'm calling for your 
 help  knowledge.
 
 bellow is the definition of the font library :
 
 [Bindable]
 public final class FontsLibrary
 {
 //public static var fontLib : Array = new Array(); doesn't work
   
   /**
* The verdana font from the assets library
*/
   [Embed(source=../assets/fonts/verdana.TTF , fontName=verdana , 
 mimeType='application/x-font-truetype')]
   public static var verdana:Class;
   
   //assigning font to static attribute
 //public static var verdana : FontAsset = new LCVerdana ();
 //fontLib.push (verdana) ;
 
 .
 
 
 
 
 Bellow is the constructor of my text element
 
 public function LCTextElementField( AText : String =  , AColor : int = -1 , 
 ASize : int = -1)
 {
   super();
   
   var afont : Font = new FontsLibrary.RAVIE();
   
   this.elementText = new UITextField();   
   textFormat = new TextFormat();
 
   if (AColor != -1)
   { this.textFormat.color = AColor ; }
   
   if (ASize != -1)
   { this.textFormat.size = ASize ; }
   else
   { this.textFormat.size = 30 ; }
   
   this.textFormat.font = afont.fontName; 
   
   this.elementText.defaultTextFormat = textFormat ;
   
   this.elementText.embedFonts = true;
   this.elementText.autoSize = TextFieldAutoSize.LEFT; 
   this.elementText.antiAliasType = AntiAliasType.ADVANCED ;
   
   if (AText ==  )
   { this.elementText.text = Lorem ipsum dolor sit amet; }
   else
   { this.elementText.text = AText ; }
 
 this.addChild(this.elementText);  
 }
 
 As you can see the code is pretty basic. At the moment, I set the police to 
 RAVIE, so I can notice rapidly if the changes have been set.
 
 Any help, advice, anything would be of great use. I'm running short on ideas.





[flexcoders] Re: actionscript project need Vector

2010-03-26 Thread ouaqa
If you're working on a flex project, you might want to read the following 
article :
http://opensource.adobe.com/wiki/display/flexsdk/Targeting+Flash+Player+10
note that you should use last stable build of the flex 3.5 sdk instead of the 
v.3.0 of the sdk as they suggest in the tutorial.

--- In flexcoders@yahoogroups.com, Ninh Hieu hieusu...@... wrote:

 Vector IS NOT a part of CS4 library, it is a new class that can be run on top 
 of Flash Player 10 or above.
 To specify which flash player version your project will be based on, Right 
 click project name  Properties  Actionscript Compiler, at the Require Flash 
 Player version, type in 10.0.0.
 
 Ninh Hai Hieu
 
 --- On Fri, 3/26/10, Paul Andrews p...@... wrote:
 
 From: Paul Andrews p...@...
 Subject: Re: [flexcoders] actionscript project need Vector
 To: flexcoders@yahoogroups.com
 Date: Friday, March 26, 2010, 10:06 AM
 
 
 
 
 
 
 
  
 
 
 
   
 
 
 
   
   
   On 26/03/2010 02:57, markflex2007 wrote:
 
  Vector is part of Flash CS4 library.
 
 
 
  I need to use it in actionscript project.How to do that?
 
 
 
  Thanks
 
 
 
  Mark
 
 
 
 
 
 Use flashbuilder.





[flexcoders] Re: using Vectors and amfphp

2010-03-26 Thread ouaqa

Thanks Oleg, I'll do that. 
Still, as a lazy coder, my ideals feel betrayed :)

--- In flexcoders@yahoogroups.com, Oleg Sivokon olegsivo...@... wrote:

 Hi, the easiest way is to make custom serialization routine.
 Vectors aren't fully serializable anyway - regardless of the type parameter
 they are serialized to Vector.Object - so, it's absolutely in no way
 different from Array :(
 Besides, there aren't generics in PHP anyway, so, I think you'd be OK if you
 send vectors as arrays.
 
 Best.
 
 Oleg





[flexcoders] using Vectors and amfphp

2010-03-25 Thread ouaqa
Hello fellow flex coders,

I'm wondering if anyone ran into the same situation as I have.
I'm working on a flex/php project using amfphp for client/server communication.

Since I discovered the magnificent almighty Vector class available in flash 10, 
I'm using it in order to manipulate typed arrays. Nothing exceptional up till 
now but here comes the pickle. 

amfphp v1.9 does not handle vectors. Hence I cannot send Vectors without 
transcoding them to arrays, but this is not a sexy operation. 
Hence, I would like to modify at least the core.amf.io.AMFDeserializer class 
(and eventually the AMFSerializer class) so that it can handle arrays.

I tried to add an additional case to the AMFDeserializer.readAMF3Data() 
function handling the vector type but I get an error.

when not modifying the function, I get the following error :
undefined Amf3 type encountered: 16

16 would be the value of the vector type. So I tried to add a case handling 
this value. I tried with 16 and it's hexadecimal value but in both case, I get 
the undefined Amf3 type encountered:  but with a new number (usually 121 but 
I think it's random).

Has anyone else tried to handle vectors ? how did you do it ?
Best regards



[flexcoders] extending the eventDispatcher class.

2010-03-23 Thread ouaqa
I'm still pretty new to flex  actionscript coding and sometimes i run on some 
very frustrating problems. This is one of those.

I have an as3, and I want it to dispatch a FlexEvent.creationComplete when 
instantiation is completed.
yet, I can't make it work. I've read a lot of tutorials and my code seems OK, 
but obviously it's not the case.

here's the prototype I've developed to test event dispatching outside of my 
global application :

protoEventDispatch :

mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute 
creationComplete=init()
mx:Script
![CDATA[
import mx.events.FlexEvent;
import protoClass.MyProtoClass;

public var myObject : MyProtoClass ;

private function init() : void
{
myObject = new MyProtoClass ();

myObject.addEventListener(FlexEvent.CREATION_COMPLETE,traceIt);
}

public function traceIt (AEvent : FlexEvent) : void
{
trace( event received ! ); //not trigerred...
}


]]
/mx:Script
/mx:Application



MyProtoclass.as :

package protoClass
{
import flash.events.EventDispatcher;

import mx.events.FlexEvent;

[Event (name=creationComplete , type=mx.events.FlexEvent)]
public class MyProtoClass extends EventDispatcher
{
public function MyProtoClass() 
{
trace (creating protoclass);
myDispatchFunction();
}

public function myDispatchFunction() : void
{
dispatchEvent(new FlexEvent 
(FlexEvent.CREATION_COMPLETE ));
trace (hasEventListener(FlexEvent.CREATION_COMPLETE)); 
//output false
trace (willTrigger(FlexEvent.CREATION_COMPLETE));  
//output false
}

}
}


I'm starting to feel desperate, especially that i'm sure that it's a beginner's 
level error. As I'm the only flexcoder in my company, There is no one else I 
can turn to. I wish I could bother you with more mind puzzling problems...

Thanks in advance

The trace 





[flexcoders] Re: extending the eventDispatcher class.

2010-03-23 Thread ouaqa

Thanks a lot Oleg, you just made my day ! and saved me a lot of time.
This is a typical example of a situation where you feel very silly when you get 
the solution.
I should've read the manual a bit more seriously.

--- In flexcoders@yahoogroups.com, Oleg Sivokon olegsivo...@... wrote:

 If you dispatch an event in constructor, there may not possibly be any
 handler added to the dispatcher. You have to dispatch an event *after *the
 object is created and thus the reference to the object may be made. That is
 in your example you should call myDispatchFunction() from init() *after *you
 addEventListener().
 
 Best.
 
 Oleg





[flexcoders] bind ColorMatrixFilter to php (Apply ActionScript graphic manipulation to php)

2010-03-02 Thread ouaqa
Hello,

I am working on an online photo manipulation project. 
Users load images, modify them, and save modifications. Later, a high quality 
version of the image is printed.
Due to specification constraints, the printing process must be performed by php.

I've been looking, without success, for a way to bind actionscript 
modifications with php.

For instance, the user applies some saturation modifications to an image, and 
saves them. Since we want non-destructive image editing, the modifications are 
saved in a database(actually, the corresponding ColorMatrixFilter values). 
Later, when the user loads his images again, the modifications are loaded and 
reapplied to the image.

When launching the print job, thousands of high quality processed image must be 
handled, in php.

So, my question is : can anyone point me in some direction on how to make a 
bridge between these ColorMatrixFilter values to a graphic process, writen in 
php (using GD or anything else for example) ? 
In my idea, the php script would load the modifications from the table, maybe 
use a convert script, and then apply the filters to the high def image, before 
printing.

Thank you for your time, and possible answers. Sorry for my english.



Re: [flexcoders] How Could I not map a property to lcds object ?

2009-04-16 Thread ouaqa

It's me again.

I've been searching for a couple of hours for any documentation on the
PropertyProxy class but i didn't find much about it, except for the class
definition and a fex threads but no basic tutorial or stuff like that.

I'm stille pretty new to java  actionscript, so if anyone could point me
the direction here, I'd be greatly appreciative. Some sources, a link to a
tutorial, anything ...

I'll keep searching meanwhile, there must be a concrete example somewhere


Tim Hoff wrote:
 
 
 This is just the flex vo side.  No change to the java transfer object is
 necessary; for transient fields that live only in the flex app.
 
 -TH
 
 --- In flexcoders@yahoogroups.com, Josh McDonald j...@... wrote:

 That still requires adding the fields to the Flex object. Marking the
 field
 @Transient in Java will affect Hibernate, unless Blaze / LCDS have
 their own
 @Transient I'm not aware of. There's also this blazeds annotations
 add-on:
 http://is.gd/sETx

 SmartyPants-J will do this, but it's nowhere near escaping yet :)

 -Josh

 2009/4/16 Tim Hoff timh...@...

 
 
  Yep, here's an example:
  *
 
  private
  * *var* _myProperty:String;
 
  [Transient]
  [*Bindable*( event=*myPropertyChange* )]
  /**
  * myProperty.
  * @private
  */
  *public* *function* *get* myProperty():String
  {
  * return* _myProperty;
  }
 
  /** @private */
  *public* *function* *set* myProperty( value:String ):*void
  *{
  _myProperty = value;
  dispatchEvent( *new* Event( *myPropertyChange* ) );
  }
 
  -TH
 
  --- In flexcoders@yahoogroups.com, Amy amyblankenship@ wrote:
  
   --- In flexcoders@yahoogroups.com, ouaqa ab@ wrote:
   
   
This is an option but i was wondering if you couldn't use some
 special
ninja keyword telling lcds not to map the field to lcds.
  
   Transient?
  
 
 



 --
 Therefore, send not to know For whom the bell tolls. It tolls for
 thee.

 Josh 'G-Funk' McDonald
 - j...@...
 - http://twitter.com/sophistifunk
 - http://flex.joshmcdonald.info/

 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-Could-I-%22not%22-map-a-property-to-lcds-object---tp23059499p23077375.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] How Could I not map a property to lcds object ?

2009-04-16 Thread ouaqa

Found it !!!

thanks to your suggestions ad 
http://ozeebee.blogspot.com/2008/07/excluding-properties-from-java.html
OzeeBee's article , I got a working-yet-not-very-sexy way to bypass the
problem using 

flex.messaging.io.BeanProxy.addIgnoreProperty(My.class, Property);




ouaqa wrote:
 
 It's me again.
 
 I've been searching for a couple of hours for any documentation on the
 PropertyProxy class but i didn't find much about it, except for the class
 definition and a fex threads but no basic tutorial or stuff like that.
 
 I'm still pretty new to java  actionscript, so if anyone could point me
 the direction here, I'd be greatly appreciative. Some sources, a link to a
 tutorial, anything ...
 
 I'll keep searching meanwhile, there must be a concrete example somewhere
 
 
 Tim Hoff wrote:
 
 
 This is just the flex vo side.  No change to the java transfer object is
 necessary; for transient fields that live only in the flex app.
 
 -TH
 
 --- In flexcoders@yahoogroups.com, Josh McDonald j...@... wrote:

 That still requires adding the fields to the Flex object. Marking the
 field
 @Transient in Java will affect Hibernate, unless Blaze / LCDS have
 their own
 @Transient I'm not aware of. There's also this blazeds annotations
 add-on:
 http://is.gd/sETx

 SmartyPants-J will do this, but it's nowhere near escaping yet :)

 -Josh

 2009/4/16 Tim Hoff timh...@...

 
 
  Yep, here's an example:
  *
 
  private
  * *var* _myProperty:String;
 
  [Transient]
  [*Bindable*( event=*myPropertyChange* )]
  /**
  * myProperty.
  * @private
  */
  *public* *function* *get* myProperty():String
  {
  * return* _myProperty;
  }
 
  /** @private */
  *public* *function* *set* myProperty( value:String ):*void
  *{
  _myProperty = value;
  dispatchEvent( *new* Event( *myPropertyChange* ) );
  }
 
  -TH
 
  --- In flexcoders@yahoogroups.com, Amy amyblankenship@ wrote:
  
   --- In flexcoders@yahoogroups.com, ouaqa ab@ wrote:
   
   
This is an option but i was wondering if you couldn't use some
 special
ninja keyword telling lcds not to map the field to lcds.
  
   Transient?
  
 
 



 --
 Therefore, send not to know For whom the bell tolls. It tolls for
 thee.

 Josh 'G-Funk' McDonald
 - j...@...
 - http://twitter.com/sophistifunk
 - http://flex.joshmcdonald.info/

 
 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-Could-I-%22not%22-map-a-property-to-lcds-object---tp23059499p23078477.html
Sent from the FlexCoders mailing list archive at Nabble.com.



[flexcoders] How Could I not map a property to lcds object ?

2009-04-15 Thread ouaqa

I am developping a J2EE/Flex Application and we recently decided to switch to
hibernate to handle our database management strategy. 

The java/as mapping worked real smoothly before. All properties declared in
java objects were also declared in as object.

When switching to hibernate, i had to add some properties to the java
objects, in order to have all my fields declared in the object.
So now, the java object has more properties than the actionscript object and
therefore, i get a #1056 error when creating the object (Cannot create
property XXX on object myObject).

I do not wish to add these missing properties in actionscript so this is why
I would like to know how to not  map a java attribute  to it's
actionscript-sided object.

sorry about my english, frenchy @ work ...

-- 
View this message in context: 
http://www.nabble.com/How-Could-I-%22not%22-map-a-property-to-lcds-object---tp23059499p23059499.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] How Could I not map a property to lcds object ?

2009-04-15 Thread ouaqa

This is an option but i was wondering if you couldn't use some special
ninja keyword telling lcds not to map the field to lcds.

Still, thanks for the suggestion, valdhor

valdhor-3 wrote:
 
 If it were me, I would leave the java and as objects as they were and
 create a new class extending the java object. Now you can add all the
 properties that hibernate wants and send it.
 
 
 --- In flexcoders@yahoogroups.com, ouaqa a...@... wrote:

 
 I am developping a J2EE/Flex Application and we recently decided to
 switch to
 hibernate to handle our database management strategy. 
 
 The java/as mapping worked real smoothly before. All properties declared
 in
 java objects were also declared in as object.
 
 When switching to hibernate, i had to add some properties to the java
 objects, in order to have all my fields declared in the object.
 So now, the java object has more properties than the actionscript object
 and
 therefore, i get a #1056 error when creating the object (Cannot create
 property XXX on object myObject).
 
 I do not wish to add these missing properties in actionscript so this is
 why
 I would like to know how to not  map a java attribute  to it's
 actionscript-sided object.
 
 sorry about my english, frenchy @ work ...
 
 -- 
 View this message in context:
 http://www.nabble.com/How-Could-I-%22not%22-map-a-property-to-lcds-object---tp23059499p23059499.html
 Sent from the FlexCoders mailing list archive at Nabble.com.

 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-Could-I-%22not%22-map-a-property-to-lcds-object---tp23059499p23061699.html
Sent from the FlexCoders mailing list archive at Nabble.com.