RE: [flexcoders] A way to animate or move a list smoothly? My attempt in Flex 3 works, Flash builder not so much.

2010-05-03 Thread Chet Haase

I can't run the code to see what you're seeing since it refers to objects that 
aren't here, but for the deceleration movement behavior you describe, you 
probably want to check out the 'easer' property of Flex 4 effects. This 
property lets you define the timing behavior of your animations, with the 
default being a Sine motion that accelerates into and then decelerates out of 
the animation. You might want something like Linear, or one of the various 
other options.
I talk about easing in Flex effects in this video (among others):

http://graphics-geek.blogspot.com/2009/11/video-transitions-and-easing-in-flex.html

Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Raymond Brown
Sent: Monday, May 03, 2010 8:37 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] A way to animate or move a list smoothly? My attempt in 
Flex 3 works, Flash builder not so much.


I have a horizontal list of objects (image and labels) that I want to slide to 
the left smoothly, in a consistent speed till the last object goes off screen 
and then repeat.  However my code, as seen below has two weird effects.  First 
it hauls butt across the screen way to fast to be readable and second somewhere 
around the middle of the screen the speed jumps up a notch till the very end 
where it seems to slow down.  Can someone point me to where I may be working 
the Move function wrong?

?xml version=1.0 encoding=utf-8?

   xmlns:s=library://ns.adobe.com/flex/spark
   xmlns:mx=library://ns.adobe.com/flex/mx
   minWidth=955 minHeight=600 backgroundColor=0x00
   preinitialize=preInit() creationComplete=complete()

fx:Script
![CDATA[
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
 ! ;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;

import org.osmf.events.TimeEvent;

[Bindable] public var ac:ArrayCollection;
private var t:Timer;

private function preInit():void
{
  nb! sp; ac = new ArrayCollection([{name: '6501 Primary Clock 
Wander', code: '1', lastHeard: 'No time for losers'},
{name: '6502 Card 5 Failure', code: '0', lastHeard: 'Cause 
we are the champions'},
{name: '5701 Primary Died', code: '-1', lastHeard: 'Of the 
world'},
{name: 'APC Power Strip, socket 8 malfunctioning', code: 
'1', lastHeard: 'No pleasure cruise.'}]);

//go get the data
ADService.send();

//timer - fire every 2 seconds and 0 means infinite run
t = new Timer(2000, 0);
t.addEventListener(TimerEvent.TIMER, timerFired);
startTimer();
}

private function complete():void
{
move_left.xFrom = group.width + dataList.width;
move_left.xTo = 0 - dataList.width;
move_left.repeatCount = 0; //loop
move_left.repeatDelay = 0; //loop time
move_left.duration = 1;
move_left.play();
}

private function timerFired(evt:TimeEvent):void
{
ADService.send();
}
  n! bsp;
private function startTimer():void
{
t.start();
}

private function stopTimer():void
{
t.stop();
}

private function move_pause():void
{
move_left.pause();
}

private function move_resume():void
{
move_left.resume();
}

private function selectedItem(event:Event):void
{
Alert.show(event.target.pointer);
}

]]
/fx:Script

fx:Declarations
s:Move id=move_left target={dataList} /

/fx:Declarations

s:layout
s:HorizontalLayout verticalAlign=middle horizontalAlign=center/
/s:layout


!--Create a RssItemRenderer as a simple component containing a colored 
image and you will see what I mean.--
s:Group id=group width=100% height=100% rollOver=move_pause() 
rollOut=move_resume()
s:List itemRenderer=RssItemRenderer dataProvider={ac}
  nb! sp; click=selectedItem(event) 
contentBackgroundColor=0x00
borderVisible=true  id=dataList moveEffect=move_left
s:layout
s:HorizontalLayout verticalAlign=middle 
horizontalAlign=center/
/s:layout
/s:List
/s:Group

/s:Application




RE: [flexcoders] Draw three rectangles inside a canvas -----URGENT PLEASE

2010-04-20 Thread Chet Haase

I can't tell what you're trying to do, but this code works:

s:Panel width=400 height=300
s:Rect width=100 height=100
s:fill
s:SolidColor color=red/
/s:fill
/s:Rect
s:Rect x=200 width=100 height=100
s:fill
s:SolidColor color=blue/
/s:fill
/s:Rect
/s:Panel

I can't tell if you are trying to use a Canvas or a Panel, since you mention 
both. Note that Canvas does not spark equivalent, and you can't add Rect 
objects directly to a halo container. But toss a Group in there and you can add 
anything to the group.

Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Nini7016 Nini7016
Sent: Tuesday, April 20, 2010 4:19 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Draw three rectangles inside a canvas -URGENT PLEASE



Hello

I have a canvas and I would like to add  within this canvas three rectangles 
superimposed and just between two rectangles there will be space.

I used the panel and I put in rectangles but this was not the case.

you have any ideas please

Any help

do you think i must use any other component flex apart Panel ??


Thank you very much



Envie de naviguer sur Internet sans laisser de trace? La solution avec Internet 
Explorer 8http://clk.atdmt.com/FRM/go/207186970/direct/01/



RE: [flexcoders] Tutorials or pointing me in the right direction

2010-02-18 Thread Chet Haase

Hi,

I posted a simple drawing app tutorial a couple of years ago that you might 
check out. It has the basics in it like listening for mouse down/move/up events 
and causing drawing operations based on them. It's based on Flex 3, when 
drawing was a bit more involved than it is in Flex 4 - you have to create Flash 
DisplayObjects and issue graphics calls to them. In Flex 4 you could just use 
the Flex graphics primitives. But it's not too bad, and hopefully it'll help 
you get started:

These are the videos, but they reference earlier articles, and all the 
code/demos are in the various blog entries.
http://graphics-geek.blogspot.com/2008/06/video-top-drawer-part-i.html
http://graphics-geek.blogspot.com/2008/06/video-top-drawer-parts-ii-iii.html

Good luck...

Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Wally Kolcz
Sent: Thursday, February 18, 2010 12:21 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Tutorials or pointing me in the right direction



I need to create a coloring tool, for a sick children's portal, where I
can lay a vector outline on the screen and the kids can color it. It
doesnt have to always be 'in the lines' so a background image would be
fine. That part is no problem...

However I don't even know where to start on how to make a took that when
the mouse button is depressed it starts to draw (or color) a line. Any
ideas where I can get a tutorial or a source code block for that?

Thanks!

inline: image001.jpginline: image002.jpg

RE: [flexcoders] Exporting Flex animation to animated GIF?

2009-12-07 Thread Chet Haase

A partial solution would be to handle update events  from the main effect 
running the animation and capture a screenshot of the application (ImageCapture 
or the BitmapUtil class in Flex 4) for each update, then save those bitmaps as 
images (not sure how to turn those separate images into one animated gif, but 
I'm sure that's a well-trodden problem).

Note that capturing the screenshots may be time-consuming, depending on how 
complex the UI is, so you may want to run a longer animation just for this 
capture process.

Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Peter Davis
Sent: Monday, December 07, 2009 7:31 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Exporting Flex animation to animated GIF?



I have a simple Flex animation (http://www.peterdavis.info/LogoAnimation.html) 
that I'd like to turn into an animated GIF, for two reasons:

1) To make the background transparent, and
2) To run in browsers that have a Flash blocker enabled.

Can anyone suggest a simple way to do this?

Thanks!

-pd



RE: [flexcoders] Matrix3D error

2009-11-03 Thread Chet Haase
The old projects from FB4 imported classes from the Flex 4 sdk and your Flex 3 
compiler is complaining about classes that it can't find in Flex 3.

If you want to compile against Flex 4 in FB3, then set up your SDKs to add the 
Flex 4 SDK, and point your project(s) at that SDK instead of the default Flex 3 
SDK.

If you're just building Flex3 code (and your projects that you imported aren't 
using and Flex 4-isms), then do a clean on those projects and rebuild.


Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Agha Mehdi
Sent: Tuesday, November 03, 2009 11:13 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Matrix3D error



All,

I just installed FB 3 and now my imported projects done in FB 4 beta 2 give me 
this error

Type was not found or was not a compile-time constant: Matrix3D.


How do I get rid of this?


Thanks



RE: [flexcoders] Chet Haase explains the graphics stack in Flash Player

2009-11-02 Thread Chet Haase

... and I also try to get around to answering questions on this group when I 
can.

I think the video you're referring to is one of the Top Drawer ones (probably 
the one that dealt with drawing the graphics shapes), which were some of the 
first videos I posted on my blog. Or maybe it was the one I did for the Flex 
in a Week series:
http://graphics-geek.blogspot.com/2008/11/video-custom-flash-graphics.html

If you want to poke around, you can see all of the videos I've posted on my 
blog under the video tag:
http://graphics-geek.blogspot.com/search/label/video

Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Vivian Richard
Sent: Monday, November 02, 2009 3:07 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Chet Haase explains the graphics stack in Flash Player




   You can ask this question directly to Chet. He is very prompt
   answering any question through his blog. Here is the link -
   http://graphics-geek.blogspot.com/

On Mon, Nov 2, 2009 at 2:43 PM, dorkie dork from dorktown 
dorkiedorkfromdorkt...@gmail.commailto:dorkiedorkfromdorkt...@gmail.com 
wrote:


I'm looking for the video where Chet describes how the graphics object
passes drawing commands to the Flash Player. It was something about
how there is a stack of commands that gets called every frame render.
Thanks,




RE: [flexcoders] Re: Converting RGB to Hex color

2009-09-29 Thread Chet Haase

Nope: HSBColor is a utility class for dealing with colors represented in the 
HSB (Hue, Saturation, and Balance) color space. It will help you convert 
between RGB and HSB colors, but will not help you with RGB to hex string 
conversions.

Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of turbo_vb
Sent: Tuesday, September 29, 2009 1:35 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Converting RGB to Hex color



There's a utility in the sdk to convert rgb string to uint. For Flex4 it's 
mx.utils.HSBColor.

-TH

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Greg 
Hess flexeff...@... wrote:

 Hi All,

 I am trying to externalize our effect styles to css. However, when I
 read in the color values getStyle() they come in RGB format and
 GlowFilter needs Hex. I have found lots of posts of people writing
 rgbToHex conversion function but I find it strange that this is not
 available in the Flex SDK.

 What is the best way to do such conversions.

 Any help much appreciated,

 Greg




RE: [flexcoders] How to make the effect smooth

2009-09-25 Thread Chet Haase

Scaling text is a funny thing. Generally, you won't get what you're asking for 
- smooth-scaling. The problem is that to display text in any reasonable way (in 
a way where it won't look completely ugly), graphics engines use things like 
font metrics, point sizes, font hints, sub-pixel anti-aliasing, and anything 
else they can to make it look readable. This is quite different from simple 
graphic objects. This means that when you 'scale' a text string, it will always 
try to display itself in a point size that's appropriate to the scale factor. 
And that means it's going to snap as it scales up and down, as it hits 
different point sizes.

This problem is related to why the text would simply disappear in Flex 3 when a 
text component was rotated or faded - by default, we would use a device font, 
and that engine just couldn't display the text in any reasonable manner when it 
was transformed or faded. (the workaround was to use an embedded font - I'm 
just illustrating the problems here...) This is different in Flex 4, since we 
use the new Flash player 10 text engine that uses software rendering for text 
and avoids the device rendering issues. But still, you'll get a much different 
looking text string when rotated than you will when it's not rotated, because 
various font display tricks break down when they're not linearly displayed.

The only workaround for this I know of is to attempt to capture the text as an 
image and scale that instead. In this case, draw your text component to some 
bitmap and swap it out for the duration of the effect.

But even that won't give you a nice result. That is, you'll get smooth scaling 
of the graphics (including the text), but the text won't look very good (for 
the simple reason that text drawn without all of the font tricks mentioned 
above tends to look horrible, and scaled bitmaps of the text will look even 
worse), and if you swap this scaled version of the text out for the real text 
when the effect finishes, you'll get a snapping artifact, as we go from the 
bitmap display of the text to the real display of the text at the appropriate 
point size. I'm pretty sure this isn't what you want either.

The best way I know of to deal with this harsh text reality is to work around 
it, and they way you do it depends on your situation. For example, you might 
just fade the text out at the start of the effect, scale up the text area, then 
fade it back in when it's done. This way you'll get good text display at the 
beginning and end, and will avoid the snapping artifacts as it scales. You 
could also do things like capture the text into a bitmap and scale it, but also 
apply a blur and/or fade, so that the user can see the text, but in such a way 
that the difference between the animated version and the before/after version 
is less jarring.

Hope that helps.

Chet.

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of ilikeflex
Sent: Thursday, September 24, 2009 8:47 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to make the effect smooth



Hi

I am using the below sample to increase the width and height but i want that 
the text should also transit smoothly.

Any pointers???

?xml version=1.0 encoding=utf-8?
!-- Simple example to demonstrate the Zoom effect. --
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;

mx:Parallel id=expand target={textBox}
mx:AnimateProperty property=scaleX fromValue=1 toValue=2 duration=2000 
/
mx:AnimateProperty property=scaleY fromValue=1 toValue=2 duration=2000 
/
/mx:Parallel

mx:Parallel id=contract target={textBox}
mx:AnimateProperty property=scaleX fromValue=2 toValue=1 duration=2000 
/
mx:AnimateProperty property=scaleY fromValue=2 toValue=1 duration=2000 
/
/mx:Parallel

mx:Panel title=Zoom Effect Example width=95% height=95% 
horizontalAlign=center
paddingTop=5 paddingLeft=10 paddingRight=10 paddingBottom=5
!--
mx:HBox backgroundColor=blue width=75 id=textBox
mx:Text width=100% color=0xFF fontWeight=bold text=1234567890/
/mx:HBox
--
mx:TextInput backgroundColor=blue fontWeight=bold color=0xFF 
id=textBox text=1234567890

/mx:TextInput
mx:ControlBar
mx:Button label=Expand click=expand.end(); expand.play();/
mx:Button label=Contract click=contract.end(); contract.play();/
/mx:ControlBar

/mx:Panel
/mx:Application

Thanks
ilikeflex



RE: [flexcoders] Flex 3d Tweening and best practice/results for Text

2009-08-08 Thread Chet Haase

Ah, okay. The yes: resetting the matrix seems to be the way to workaround this 
problem (which must be what we’re doing internally, as of Flex 4).

Thanks,
Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of thomas parquier
Sent: Saturday, August 08, 2009 6:31 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex  3d Tweening and best practice/results for Text



Chet,

The blurry effect doesnt occur any more with sdk4.
The component I wrote uses sdk3.3, which leaves blurry the buttons from the 
example code you sent.

thomas
---
http://www.web-attitude.fr/
msn : thomas.parqu...@web-attitude.frmailto:thomas.parqu...@web-attitude.fr
softphone : sip:webattit...@ekiga.netmailto:sip%3awebattit...@ekiga.net
téléphone portable : +33601 822 056

2009/8/8 Chet Haase cha...@adobe.commailto:cha...@adobe.com




That’s not what I’m seeing: in the code below, the rotator effect rotates the 
button around the Y axis, ending at rotationY==0, at which point the text in 
the button is no longer blurry:



?xml version=1.0 encoding=utf-8?

mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute

mx:AnimateProperty id=rotator property=rotationY fromValue=360 
toValue=0 target={button1}/

mx:Button id=button x=10 label=Move Me click=button.z = (button.z 
== 100) ? 0 : 100/

mx:Button id=button1 x=10 y=50 label=Rotate Me 
click=rotator.play()/

/mx:Application



Are you doing anything with the 3D properties besides setting rotationY? Post 
all of the code (if you can boil it down to a simple case)



Chet.





From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On 
Behalf Of thomas parquier
Sent: Friday, August 07, 2009 3:40 PM

To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex  3d Tweening and best practice/results for Text





Chet,

Yet in a mxml component I had to do the following :

mx:AnimateProperty property=rotationY toValue=0 duration=700 
effectEnd=twoSidedDO3D.transform.matrix=new Matrix(1,0,0,1,width/2,0);  /

thomas
---
http://www.web-attitude.fr/
msn : thomas.parqu...@web-attitude.frmailto:thomas.parqu...@web-attitude.fr
softphone : sip:webattit...@ekiga.netmailto:sip%3awebattit...@ekiga.net
téléphone portable : +33601 822 056

2009/8/7 Chet Haase cha...@adobe.commailto:cha...@adobe.com





You don’t necessarily have to reset the 2d matrix – you just have to make sure 
that all of your 3d properties are set back to the values they would have if 
the object were again in 2d.



In the original example, if the only thing you did was to change the z 
location, and then you reset it to 0, then the text should not be blurry any 
longer (we recognize that the object no longer needs a 3D transform and just do 
the right 2D thing instead). I suspect that you are setting more 3D properties 
than simply the z property (like rotationX, rotationY, etc.), so even though 
you’re zeroing-out the ‘z’ property, that’s not enough to take the object out 
of 3D and put it on the 2D plane again.



Figure out the other 3D properties that you’re tweaking (just take a look at 
the matrix when it’s back in the state where you think it should be 2D) and 
reset the ones that are still in 3D.



Chet.





From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On 
Behalf Of thomas parquier
Sent: Friday, August 07, 2009 11:21 AM
To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex  3d Tweening and best practice/results for Text





Hi,

When objects are back to 2d, you have to reset 2d matrix to get rid of blurry 
effect.

thomas
---
http://www.web-attitude.fr/
msn : thomas.parqu...@web-attitude.frmailto:thomas.parqu...@web-attitude.fr
softphone : sip:webattit...@ekiga.netmailto:sip%3awebattit...@ekiga.net
téléphone portable : +33601 822 056

2009/8/5 djhatrick djhatr...@yahoo.commailto:djhatr...@yahoo.com



I have a displayObject, a panel, doing 3d stuff with the panel... However after 
I tween my object to z=0, the text looks blurry after the animation has stopped.

Is there a way to make the text look sharp:

fontAntiAliasType=advanced

I've tried but that gives not-passable results.

Thanks,
Patrick








RE: [flexcoders] Flex 3d Tweening and best practice/results for Text

2009-08-07 Thread Chet Haase

You don’t necessarily have to reset the 2d matrix – you just have to make sure 
that all of your 3d properties are set back to the values they would have if 
the object were again in 2d.

In the original example, if the only thing you did was to change the z 
location, and then you reset it to 0, then the text should not be blurry any 
longer (we recognize that the object no longer needs a 3D transform and just do 
the right 2D thing instead). I suspect that you are setting more 3D properties 
than simply the z property (like rotationX, rotationY, etc.), so even though 
you’re zeroing-out the ‘z’ property, that’s not enough to take the object out 
of 3D and put it on the 2D plane again.

Figure out the other 3D properties that you’re tweaking (just take a look at 
the matrix when it’s back in the state where you think it should be 2D) and 
reset the ones that are still in 3D.

Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of thomas parquier
Sent: Friday, August 07, 2009 11:21 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex  3d Tweening and best practice/results for Text



Hi,

When objects are back to 2d, you have to reset 2d matrix to get rid of blurry 
effect.

thomas
---
http://www.web-attitude.fr/
msn : thomas.parqu...@web-attitude.frmailto:thomas.parqu...@web-attitude.fr
softphone : sip:webattit...@ekiga.netmailto:sip%3awebattit...@ekiga.net
téléphone portable : +33601 822 056

2009/8/5 djhatrick djhatr...@yahoo.commailto:djhatr...@yahoo.com


I have a displayObject, a panel, doing 3d stuff with the panel... However after 
I tween my object to z=0, the text looks blurry after the animation has stopped.

Is there a way to make the text look sharp:

fontAntiAliasType=advanced

I've tried but that gives not-passable results.

Thanks,
Patrick




RE: [flexcoders] Flex 3d Tweening and best practice/results for Text

2009-08-07 Thread Chet Haase

That’s not what I’m seeing: in the code below, the rotator effect rotates the 
button around the Y axis, ending at rotationY==0, at which point the text in 
the button is no longer blurry:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute
mx:AnimateProperty id=rotator property=rotationY fromValue=360 
toValue=0 target={button1}/
mx:Button id=button x=10 label=Move Me click=button.z = (button.z 
== 100) ? 0 : 100/
mx:Button id=button1 x=10 y=50 label=Rotate Me 
click=rotator.play()/
/mx:Application

Are you doing anything with the 3D properties besides setting rotationY? Post 
all of the code (if you can boil it down to a simple case)

Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of thomas parquier
Sent: Friday, August 07, 2009 3:40 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex  3d Tweening and best practice/results for Text



Chet,

Yet in a mxml component I had to do the following :
mx:AnimateProperty property=rotationY toValue=0 duration=700 
effectEnd=twoSidedDO3D.transform.matrix=new Matrix(1,0,0,1,width/2,0);  /

thomas
---
http://www.web-attitude.fr/
msn : thomas.parqu...@web-attitude.frmailto:thomas.parqu...@web-attitude.fr
softphone : sip:webattit...@ekiga.netmailto:sip%3awebattit...@ekiga.net
téléphone portable : +33601 822 056

2009/8/7 Chet Haase cha...@adobe.commailto:cha...@adobe.com




You don’t necessarily have to reset the 2d matrix – you just have to make sure 
that all of your 3d properties are set back to the values they would have if 
the object were again in 2d.



In the original example, if the only thing you did was to change the z 
location, and then you reset it to 0, then the text should not be blurry any 
longer (we recognize that the object no longer needs a 3D transform and just do 
the right 2D thing instead). I suspect that you are setting more 3D properties 
than simply the z property (like rotationX, rotationY, etc.), so even though 
you’re zeroing-out the ‘z’ property, that’s not enough to take the object out 
of 3D and put it on the 2D plane again.



Figure out the other 3D properties that you’re tweaking (just take a look at 
the matrix when it’s back in the state where you think it should be 2D) and 
reset the ones that are still in 3D.



Chet.





From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On 
Behalf Of thomas parquier
Sent: Friday, August 07, 2009 11:21 AM
To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex  3d Tweening and best practice/results for Text





Hi,

When objects are back to 2d, you have to reset 2d matrix to get rid of blurry 
effect.

thomas
---
http://www.web-attitude.fr/
msn : thomas.parqu...@web-attitude.frmailto:thomas.parqu...@web-attitude.fr
softphone : sip:webattit...@ekiga.netmailto:sip%3awebattit...@ekiga.net
téléphone portable : +33601 822 056

2009/8/5 djhatrick djhatr...@yahoo.commailto:djhatr...@yahoo.com



I have a displayObject, a panel, doing 3d stuff with the panel... However after 
I tween my object to z=0, the text looks blurry after the animation has stopped.

Is there a way to make the text look sharp:

fontAntiAliasType=advanced

I've tried but that gives not-passable results.

Thanks,
Patrick






RE: [flexcoders] Loading Images

2009-08-05 Thread Chet Haase

Since img is in a ViewStack, it seems like it's probably not yet instantiated. 
If it hasn't been made visible yet, then it won't be instantiated and it will 
be null, so your call to load() will fail as it does below.

If you're trying to display the larger version of the image and the thumbnails 
at the same time, I would think you wouldn't actually want a ViewStack, which 
only displays one child at a time.

Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Fernando Cabredo
Sent: Wednesday, August 05, 2009 5:28 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Loading Images


Hi,

The purpose of the lines of code below is to display a ListBox at the left pane 
and a Tile List at the right pane. When an image is double-clicked in the Tile 
List, I would like to display an enlarge version of the image. However, I am 
encountering this error when I want to load the selected image into the IMAGE 
control:

TypeError: Error #1009: Cannot access a property or method of a null object 
reference.
at 
PicGallery/imageClickHandler()[C:\adobeFlexTraining\_workspace\PicGallery\flex_src\PicGallery.mxml:43]
at 
PicGallery/__tileImages_doubleClick()[C:\adobeFlexTraining\_workspace\PicGallery\flex_src\PicGallery.mxml:97]

And the line of code being referred to by the error is my code below in red 
font:

private function imageClickHandler(ev:Event):void {
var selectedImage:String = ;
imagefilename = 
http://localhost:8080/PicGallery/assets/staging/+selectedImagehttp://localhost:8080/PicGallery/assets/staging/%22+selectedImage;
img.load(imagefilename);
viewstack1.selectedChild = view2;
}

You may need my complete code so I posted them below.

Your help will be much appreciated. Thank you.

Fernando


?xml version=1.0 encoding=utf-8?

horizontalAlign=center verticalAlign=middle 
creationComplete=loginJCR();
mx:Script
![CDATA[
import mx.rpc.events.FaultEvent;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;

[Bindable]
private var folderdata:ArrayCollection = new ArrayCollection();

[Bindable]
private var filelistdata:ArrayCollection = new ArrayCollection();

[Bindable]
private var imagefilename:String=;

  nb! sp; private function loginJCR():void {

loginJRService.loginRepository(http://toshiba:8080/jackrabbit-webapp-1.5.6/rmi,admin,adminhttp://toshiba:8080/jackrabbit-webapp-1.5.6/rmi%22,%22admin%22,%22admin);
}

private function loginHandleResult(ev:ResultEvent):void {
var loginresult:String = ev.result as String;
getFolderListService.getFolderList();
   ! ;
}

private function lstFoldersClickHandler(ev:Event):void {
var selectedNode:String = lstFolders.selectedItem.nodename;
viewstack1.selectedChild = view1;
getFilesByFolderService.getFilesByFolder(/+selectedNode);
imagefilename = ;
}

 nbs! p;  private function getImage(event:Event):void
{
img.load(event.currentTarget.getRepeaterItem());
}
private function imageClickHandler(ev:Event):void {
var selectedImage:String = ;
imagefilename = 
http://localhost:8080/PicGallery/assets/staging/+selectedImagehttp://localhost:8080/PicGallery/assets/staging/%22+selectedImage;
img.load(imagefilename);
viewstack1.selectedChild = view2;
}

private function getFoldersHandleResult(ev:ResultEvent):void {
folderdata = ev.result as ArrayCollection;
}

private function getFilesByFolderHandleResult(ev:ResultEvent):void {
filelistdata = ev.result as ArrayCollection;
}

private function handleFault(ev:FaultEvent):void {
var message:String = Error: 
+ ev.fault.faultCode +  - 
+ ev.fault.faultDetail +  - 
+ ev.fault.faultString;
}
]]
/mx:Script
mx:RemoteObject id=loginJRService destination=jcrservice
result=loginHandleResult(event)fault=handleFault(event) 
showBusyCursor=true /
mx:RemoteObject id=getFolderListService destination=jcrservice 
result=getFoldersHandleResult(event) fault=handleFault(event) 
showBusyCursor=true/
mx:RemoteObject id=getFilesByFolderService destination=jcrservice 
result=getFilesByFolderHandleResult(event) fault=handleFault(event) 
showBusyCursor=true/

mx:VBox width=100% height=20% horizontalAlign=center 
verticalAlign=middle verticalGap=0
mx:Image source=assets/header-2a.jpg scaleContent=false 
autoLoad=true/
mx:Label 

RE: [flexcoders] Re: problem using mx:Glow and mx:Box

2009-07-27 Thread Chet Haase

Box doesn't have a fill by default, so you're seeing right through the 
container to the background behind it. The glow you're seeing inside the box is 
actually just a general glow around each of the container's elements. You'd get 
the same result with a Canvas, although a Panel has a fillled background and 
doesn't have this effect.

You can get the effect you're looking for by setting a background color on the 
box:

mx:Box height=100 width=200 mouseDownEffect={glowImage} 
backgroundColor=white
 borderColor=black borderStyle=solid 

Chet.



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of mitchgrrt
Sent: Monday, July 27, 2009 7:10 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: problem using mx:Glow and mx:Box



Also in the example, the inner hello label gets the glow. It seems like the 
Glow is applied to the outer and inner borders of the Box, and also to objects 
inside the Box. Does anybody know how to make the Glow effect just the outside 
of the Box? Thanks.

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
mitchgrrt mitch_g...@... wrote:

 I'm trying to put a Glow around a Box, and have the glow show around the 
 outside of the Box's borders but not the inside. Here's part of the code:

 mx:Glow id=glowImage duration=1000
 alphaFrom=1.0 alphaTo=0.3
 blurXFrom=0.0 blurXTo=50.0
 blurYFrom=0.0 blurYTo=50.0
 inner=false
 color=0x00FF00/

 mx:Box height=100 width=200 mouseDownEffect={glowImage}
 borderColor=black borderStyle=solid 

 mx:Label text=hello /
 /mx:Box

 The Glow shows up both inside and outside the Box's borders, even though I 
 set inner=false. Does somebody know how to get it to show just outside the 
 box? Thanks.




RE: [flexcoders] How to link effects so that one starts after one finishes?

2009-07-09 Thread Chet Haase

There are a couple of ways you could make this work:


1)  Simplest: make your triggered effects do the right thing (the appearing 
one waits for the disappearing one to finish, via a startDelay):

mx:WipeDown id=wipeDown duration=700 /
mx:WipeUp id=wipeUp duration=700 startDelay=700/

This would ensure that the wipeUp effect (which always runs on the component 
coming into view, in your example) will not run until the duration of the 
wipeDown (used for the disappearing component) is finished.


2)  More involved: Use transitions
Instead of triggers for these one-off effects, you could set up your 
application to use states for your components. in one state, the DataGrid would 
be there anre the List would not, in the other state the List would be there 
and the DataGrid would not. Then you could set up transitions for these states. 
It's a bit more involved, but might scale better than just running individual 
effects on the components.

Chet.

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of gmoniey22
Sent: Wednesday, July 08, 2009 6:29 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to link effects so that one starts after one finishes?





I have two components, and I want to swap between them using wipe down/up. i.e. 
click a button, the visible panel slides down, and after that panel is no 
longer visible, the other panel slides up and takes its place.

I have tried something like the following (please excuse the crude example), 
but the effects occur at the same time, and it doesn't look that good.

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute
mx:Script
![CDATA[
import mx.binding.utils.BindingUtils;

[Bindable]
private var _show:Boolean = true;

private function swapShow(event:MouseEvent):void {
_show = !_show;
}
]]
/mx:Script


mx:WipeDown id=wipeDown duration=700 /
mx:WipeUp id=wipeUp duration=700 /

mx:VBox
mx:DataGrid visible={_show} includeInLayout={_show} showEffect=wipeUp 
hideEffect=wipeDown /
mx:List visible={!_show} includeInLayout={!_show} showEffect=wipeUp 
hideEffect=wipeDown/
mx:Button label=Swap click=swapShow(event) /
/mx:VBox
/mx:Application



RE: [flexcoders] About effect in Flex4

2009-07-06 Thread Chet Haase

Transitions work just fine in flex4, but you need to declare them in a 
transitions block (just like in flex3), not in the Declarations block:

s:transitions
s:Transition fromState=”primary” toState=”secondary”
s:Sequence targets=”{[panel1]}”
// etc.

Note that Blur is not an effect in Flex4, but it should work fine as long as 
you target a component (flex3 effects don’t work on graphic elements, which is 
one of the reasons for the new flex4 effects). To get a flex4 effect that runs 
a blur, use AnimateFilter with a BlurFilter specified as the filter you are 
animating.

Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of j2me_soul
Sent: Tuesday, June 23, 2009 11:30 PM
To: flexcoders
Subject: [flexcoders] About effect in Flex4




When I clicked the button to change state,but the transition effect doesn't 
work.
I wonder if the transition is still available in Flex4?
s:states
  s:State name=premiere /
  s:State name=secondary /
 /s:states

 fx:Declarations
  mx:Transition fromState=premiere toState=secondary
   mx:Sequence id=t1 targets={[panel1]}
mx:Blur duration=100 blurXFrom=0.0 blurXTo=10.0
   blurYFrom=0.0 blurYTo=10.0/
mx:Parallel
 mx:Move  duration=400 xTo=0 yTo=428/
 mx:Resize duration=400 widthTo=106 heightTo=52/
/mx:Parallel
mx:Blur duration=100 blurXFrom=10.0 blurXTo=0.0
   blurYFrom=10.0 blurYTo=0.0/
   /mx:Sequence
  /mx:Transition
 /fx:Declarations

 s:Panel id=panel1 title=Panel Horizontal
x.premiere=0 y.premiere=313.1 width.premiere=1021 
height.premiere=167 
  s:HGroup
   s:Button label=Up label.secondary=Up
   click.premiere=currentState='secondary' 
click.secondary=currentState='premiere'
   label.premiere=Down/
  /s:HGroup
 /s:Panel




200万种商品,最低价格,疯狂诱惑你http://count.mail.163.com/redirect/footer.htm?f=http://gouwu.youdao.com



RE: [flexcoders] About Effect in Flex4

2009-07-06 Thread Chet Haase
both Parallel and Sequence work the same in flex4 as they did in flex3. So this:
s:Sequence
s:Move/
s:Resize/
/s:Sequence
is valid and function in flex4.

Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of j2me_soul
Sent: Tuesday, June 23, 2009 10:33 PM
To: flexcoders
Subject: [flexcoders] About Effect in Flex4




Is there something like parallel or sequence in flex4 ?
If not, how can I achieve the function like that ?




200万种商品,最低价格,疯狂诱惑你http://count.mail.163.com/redirect/footer.htm?f=http://gouwu.youdao.com



RE: [flexcoders] Overiding Hide effect? I want to hide immediately

2009-02-24 Thread Chet Haase

Triggers are good when you want a canned action to happen on a canned event. 
But you want to feed a bit more logic into it, which is starting to break the 
triggers mold. You might want to skip the trigger and handle the hide event 
specifically, then either play() the Fade effect or hide it immediately, 
depending on the situation you detect when the event fires.

And if you want a running Fade effect to hide the target(s) immediately, call 
end() on it; it should jump to the end.

Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of luvfotography
Sent: Tuesday, February 24, 2009 4:58 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Overiding Hide effect? I want to hide immediately


Hi, I've got a hideEffect on a label with a duration of 4 seconds.
When I set the visible=false on the label, it takes 4 seconds to fade
away.

Is there a way to make it disappear immediately in some cases?
I need this to also work in the middle of the fade effect.
thanks,



RE: [flexcoders] Re: A very simple code of ImageSnapshot

2009-02-12 Thread Chet Haase

You're not giving any height to your uiHolder and then you're using the height 
dimension when creating the BitmapData, so it fails because you're asking it to 
create a BitmapData with invalid dimensions. Try it with real values for both 
width and height and you'll get a better result.

Note that you're also creating an opaque BitmapData here, so you get a white 
background by default.

Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of flexawesome
Sent: Thursday, February 12, 2009 6:50 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: A very simple code of ImageSnapshot

I have also tried this code, it didn't work as well -_--

would u pls take a look? thank you

==

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute
initialize=init();

mx:Script

![CDATA[
import mx.graphics.ImageSnapshot;
import mx.controls.Button;

private var shape1:Shape;
private var shape2:Shape;

private function init():void
{
shape1 = new Shape();
shape2 = new Shape();

shape1.graphics.beginFill( 0xA4D7F4 );
shape1.! graphics.drawRect( 0 , 0 , 100, 200 );
shape1.x = 30;
shape1.y = 40;
uiHolder.addChild( shape1 );

shape2.graphics.beginFill( 0xcc9900 );
shape2.graphics.drawRect( 0 , 0 , 200, 100 );
shape2.x = 10;
shape2.y = 40;
uiHolder.addChild( shape2 );
}

private function makeBitmap(myDO:UIComponent):void
{
var myBD:BitmapData = new BitmapData(myDO.width, myDO.height);
myBD.draw(myDO );


swfLoader.load( new Bitmap ( myBD));
}
]]
/mx:Script

mx:UIComponent id=uiHolder width=100/

mx:SWFLoader id=swfLoader bottom=50 horizontalCenter=0/

mx:Bu tton id=btn label=click me to print click=makeBitmap( uiHolder );/
/mx:Application





--- In flexcoders@yahoogroups.com, flexawesome flexawes...@... wrote:

 I was trying to take snapshot of the uiHolder.

 However, I got an error msg of == ArgumentError: Error #2015:
 Invalid BitmapData.

 the simple code is here: http://www.privatepaste.com/b7gooBq4EJ


 Do you have any suggestions?

 Thank you so much




RE: [flexcoders]Architect an image gallery transition effect - design suggestions

2009-02-11 Thread Chet Haase

Seems like you're trying to do too much with triggers. Why not just handle 
whatever arbitrary event you're after (like clicking on the next/prev buttons) 
and then manually launch your custom effect with the appropriate target(s)? If 
necessary, the even handler could set up information on the effect (like the 
x/y positions for a move or whatever) prior to launching.

Chet.


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of dorkie dork from dorktown
Sent: Wednesday, February 11, 2009 6:58 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders]Architect an image gallery transition effect - design 
suggestions


I'm trying to create an image gallery component and I need some help. I have an 
Image component working. It has next and previous buttons that change the 
source of the Image component when they are clicked. This works fine so far. 
The problem is it looks like crap when it changes. How would you architect a 
source change effect so there would be a nice transition between the current 
image and the next or previous image?

For example, I want it to handle a crossfade where one image fades out and the 
next fades in or a move in effect where one image moves off the screen (and 
fades out) and another image fades in and moves in to the current image 
location. I know there is a showEffect and hideEffect but I need something like 
a sourceChangeNextEffect and a sourceChangePreviousEffect.



RE: [flexcoders] People with blogs

2008-12-04 Thread Chet Haase

My more manual approach is to simply type my blog in DreamWeaver and to 
copy/paste the raw HTML code into the Edit HTML view of my blogging page. 
This does all the transformation of 's into escape codes for me.

But my blog is on blogger.com, which has pretty bad support for coding in 
general - it's more tuned to wysiwig editing of normal text. I've heard that 
wordpress has better support for code-oriented blogs.

Chet.



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Aaron 
Hardy
Sent: Thursday, December 04, 2008 7:48 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] People with blogs


For Wordpress I use the WP-Syntax plugin.  Here's an example of what it turns 
out like:

http://aaronhardy.com/flex/finding-the-nearest-component-in-flex/

Now if I could just get more width on my page and less width on my code. :P

Aaron
On Wed, Dec 3, 2008 at 9:42 PM, Nate Pearson [EMAIL PROTECTED]mailto:[EMAIL 
PROTECTED] wrote:

Sorry this is a little off topic. I'm trying to start a flex blog but I'm not 
sure how to copy code
from flex builder into Wordpress and have the formating stay the same. Is there 
some plugin
that you use? How do you guys do it?

Thanks a lot!

-Nate




RE: [flexcoders] Zoom effect absolute positioning

2008-12-02 Thread Chet Haase
Hi Ward,

I don't think that switching to an absolute layout would have the desired 
effect. For one thing, your thumbnails probably have no explicit location and 
are just being positioned by the Canvas layout manager, so if you switch to 
absolute, they might just decide to go put themselves at (0,0).

You could turn off autoLayout for the duration of the effect, but that's 
usually a temporary thing done during and effect and not a long-term situation 
you want to be in.

One solution might be for your Canvas to be wrapped in a custom component, 
subclassing UIComponent. When you click on a thumbnail, put a copy of the image 
into the wrapping container and zoom in on that. It will then cover everything 
below it. When you zoom back out, remove it from the wrapping component, and 
you'll see everything behind it again.

Chet.


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ward 
Loockx
Sent: Tuesday, December 02, 2008 5:42 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Zoom effect absolute positioning


Hello,

I have a canvas within my application that contains polaroid images (own
flex component). When I click on a polaroid I wan't it to zoom all over
my application. When I do this now it stays within the canvas and I get
scrollbars (on that canvas). Is there a way to keep the pictures on the
canvas and still be able to zoom over my whole application (When zooming
- go to absolute layout)? Somebody that knows if this is possible ?

Thanks,
Ward



RE: [flexcoders] move effect Flex live doc example does not work

2008-12-02 Thread Chet Haase

I think the problem is that you named your application move. 'move' is a word 
that's already used in Flex (such as the move() function), so it runs into 
problems when it tries to use that word as a type as well.

name your application differently and it should work fine (it did for me, but I 
was able to reproduce your error by naming the application 'move' instead)

Chet.


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of hworke
Sent: Tuesday, December 02, 2008 8:05 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] move effect Flex live doc example does not work


Hello all,

the example in this link does not work.
http://livedocs.adobe.com/flex/3/langref/mx/effects/Move.html

The exact error message is:

Severity and Description Path Resource Location Creation Time Id

Type was not found or was not a compile-time constant: move.
[Generated code (use -keep to save): Path: move-generated.as, Line:
187, Column: 14] move Unknown 1101999455125 884

Any idea why it is not working in my Flex builder?

Regards...



RE: [flexcoders] Issues trying to create a custom image component

2008-11-28 Thread Chet Haase
I did something like this in my 'Sorted Details' demo:
http://graphics-geek.blogspot.com/2008/04/sorted-details.html
(there's also a short video of it here: 
http://graphics-geek.blogspot.com/2008/09/video-sorted-details.html)

The 'slides' in the demo are custom components, subclassing UIComponent, which 
have an Image as a child. The custom component manually resizes the Image child 
(to make it smaller than the slide) and puts a gradient background and border 
around it in the updateDisplayList() override. Check out Slide.as in the code 
for the [sorted] details.

Hope that helps

Chet.



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
dave_defusion
Sent: Friday, November 28, 2008 6:04 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Issues trying to create a custom image component


I'm trying to create a custom image component so that I can have it
with a border and rounded corners.

I tried doing it by just extending the image component, but quickly
found that it was a bit more difficult than I expected within the
image component - as I couldn't figure out how to move the image
itself around when drawing the border.

So the second solution I came up with was as follows:

* A custom component which has a child as the image
* The image has a mask applied
* The border is drawn using the custom components graphics

This all works out pretty much OK, except for two issues:

1) The child image is only ever displayed if the custom component
extends the Canvas component.

2) Resizing of the component does not work in the same way as resizing
an image component - e.g. if you set a width on an image component
then the image is scaled appropriately. With me extending the Canvas I
just get scroll bars.

The code for the component can be found here on pastie:
http://pastie.org/326072

Any ideas are greatly appreciated.



RE: [flexcoders] **View States Problem**

2008-11-27 Thread Chet Haase

States are mutually exclusive: a given component (such as the component that 
contains the states in your code below) can only be in one state at a time. 
States can be derived from each other, but that's essentially just a way to 
inherit property values from one state to the other; they are still completely 
different states. When you set the 'currentState' property, you will be put 
into that state and that state only.

It's not clear to me what you're trying to accomplish by being in 1 state at a 
time; can you elaborate on the problem you're trying to solve?

Chet.


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
malik_robinson
Sent: Wednesday, November 26, 2008 4:46 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] **View States Problem**


Hi,

I am using Flex 3

I am trying to use view states in my Flex application. My code seems
to work fine when I just have two view states, but when I have 3
states (including the base state), the screen never displays all 3 at
the same time. I am displaying these states based on the result of a
remote call, that part works fine so the remoting part of it is not
the problem.

In Flexbuilder 3 if I go into design view, I can traverse through the
states (base, state2, state3), and the visual displays look correct.

Anyone have any idea or thoughts?

Here is my code below:

mx:states

mx:State name=state2

mx:AddChild relativeTo={frm} position=lastChild 

mx:FormItem label=Select Sub Area:
mx:ComboBox
id=cb2
dataProvider={subAreaAC}
labelField=state2
width=216 left=10 top=40 minWidth=150 /
/mx:FormItem

/mx:AddChild

/mx:State

mx:State name=state3 basedOn=state2

mx:AddChild relativeTo={frm} position=lastChild 
mx:FormItem label=Select Sub-Sub Area:
mx:ComboBox
id=cb3
dataProvider={subSubAreaAC}
labelField=state3
minWidth=150 /
/mx:FormItem
/mx:AddChild

/mx:State

/mx:states

!-- this is basically my base state, this gets showed by default --
mx:Form id=frm x=10 y=10
mx:FormItem label=Select a Parent Category:
mx:ComboBox id=cb1
labelField=ParentCategory
width=150 left=10 top=40
dataProvider={catAC}
rowCount={catAC.length / 2}
/
/mx:FormItem
/mx:Form



RE: [flexcoders] Re: Architecture question using Move Effect and Events

2008-11-21 Thread Chet Haase

I'm not sure I understand the whole context, but if I'm right that there's just 
one of these custom components per app, and therefore one Move effect running 
on it at any given time, isn't it easier to just cache an instance to the 
effect itself and pause() it directly when you get the rollover event?

Chet.



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
devenhariyani
Sent: Friday, November 21, 2008 1:01 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Architecture question using Move Effect and Events


below is the code that i am using.  maybe this will help you see what i'm 
trying to do, and help how i should be properly stopping the Move Effect for UI 
components which are dynamically created at runtime.  Thanks!

public function initApp:void() {

//for each element in an ArrayCollection which was retrieved from a HTTPService

//get the element, create a new custom MXML component

var uiobj:MyCustomMXMLComponent = new MyCustomMXMLComponent();

this.canvas.addChild(uiobj);

uiobj.lblTitle = some title that i get from the array collection;

uiobj.txaBrief = some more text i get from the array collection;

//add Move Effect to the ui obj to move it on the canvas.

moveObj(uiobj);

}

public static function moveObj(obj:UIComponent):void {

var mv:Move = new Move(obj);

mv.xBy = -(500);

mv.duration = 1;

mv.play();

//add event listner to listen for mouse rollover event.

obj.addEventListener(MouseEvent.MOUSE_OVER, handleMouseRollOver);

obj.addEventListener(MouseEvent.MOUSE_OUT, handleMouseRollOut);

}

private static function handleMouseRollOver(event:MouseEvent):void {

if(event.target.parent.parent.activeEffects[0])

event.target.parent.parent.activeEffects[0].pause();

else if(event.target.parent.activeEffects[0])

event.target.parent.activeEffects[0].pause();

}

private static function handleMouseRollOut(event:MouseEvent):void {

event.target.parent.parent.activeEffects[0].resume();

}

--

MyCustomMXMLComponent.mxml

mx:VBox xmlns:mx=http://www.adobe.com/2006/mxml; horizontalScrollPolicy=off

mx:Label id=lblTitle text=DEFAULT TEXT TITLE /

mx:TextArea id=txaBrief text=DEFAULT BRIEF TEXT visible=true 
color=#c0c0c0 /

/mx:VBox

--- In flexcoders@yahoogroups.com, devenhariyani [EMAIL PROTECTED] wrote:

 Hello,

 I'm struggling on wrapping my mind around the best way to architect a
 particular feature i am developing. i have gotten my code to work,
 but i want to improve it to make it work using a more stable and
 scaleble design.

 QUESTION: Now, the problem is when a user rolls the mouse over a
 custom MXML compoenent which already has a Move effect applied to it,
 I want the MXML component to stop moving. The custom MXML component
 has a Label, Text Area,and other components inside of it, but the
 mouse roll over Event is caught by the inner most UITextField
 component. Inside the Event Handler i have a very hacky way to stop
 the Move Effect:

 event.target.parent.parent.activeEffects[0].pause();
  1. how do i make the custom MXML component catch the event instead of
 the UITextField buried deep inside the component

 2. how do i reference the MoveEffect for the MXML component without
 having to use parent.parent.activeEffects[0] since that is basically
 hardcoding.

 Any help would be greatly appreciated. For more information on my
 situation, i've posted some info:

 GOAL: the feature is simple, i have a custome MXML component that has
 a Label and a TextArea field inside of a Canvas. My flex application
 makes HttpService to my server and returns data which i put into an
 ArrayCollection. for each element in the ArrayCollection initialize
 a new custom MXML component, I bind it to my custom MXML component
 which i initialize and apply an effect to the MXML component so that
 the component moves across the screen in various pla! ces. The
 component should stop moving when a user rol! ls his/h er mouse over the
 component.


 Thanks for all of your help!

 --Deven




RE: [flexcoders] JavaFX and Flex how do we compare?

2008-11-18 Thread Chet Haase

I would be curious to find out how others view the platforms, especially from 
the standpoint of external application developers, but having been on the 
inside of both of these projects, here are some points of comparison. I'm 
attempting to be objective here and just point out some of the areas to 
consider. But since I used to work at Sun on Java/JavaFX and now work on the 
Flex team at Adobe you should filter appropriately.


-  Maturity: One of the reasons that you haven't heard much about 
JavaFX to date is that it's actually not yet released. Supposedly this will 
happen in the very near future, so maybe we'll all hear more about it at that 
time.

-  Language: Although many of the underlying capabilities of JavaFX  
rely on the Java SE platform, JavaFX itself is based on a new scripting 
language (not Java, not JavaScript, not ActionScript, but a new scripting 
language entirely). One notable differences between the languages of JavaFX and 
Flex is that Flex uses MXML for its declarative aspects, and ActionScript for 
the programmatic aspects. The JavaFX language combines both of these elements, 
having aspects of declarative and programmatic in the same code.

-  GUI capabilities: Both platforms offer GUI components, graphics, 
animation, and databinding capabilities, thought the platforms differ widely in 
syntax and capabilities of these different features.

-  Tooling: Most of the tooling so far announced for JavaFX are more on 
the code developer side; editing plugins for NetBeans, plus export plugins for 
Illustrator and Photoshop (they produce PNG files from the layers in the 
project). On the Flex side, there's the FlexBuilder IDE and the in-development 
tools such as Flash Catalyst for designer/developer workflows and FXG roundtrip 
import/export from/to the CS tools including Catalys for the graphics tags in 
the Gumbo release of the SDK.

-  Runtime availability: The availability of the JavaFX runtime is 
basically that of the Java platform (if a user's machine does not have the 
proper release of Java (I believe it will require the latest updated 10 
release), they will need to download/install it). The availability of Flex is 
basically that of the Flash platform of the appropriate version (e.g., Gumbo 
will run on FlashPlayer 10).

Chet.


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of hworke
Sent: Tuesday, November 18, 2008 8:19 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] JavaFX and Flex how do we compare?


Hi I just read the following news where I found that
SUN is also coming up with their RIA technology and
it says that it will take on AJAX and Silverlight.
It will also have desktop runtime like AIR, I guess!!!
SUN was also in MAX, San Francisco and there they also
talked about it. Now I want to know how do we compare
JavaFX and Flex?

http://tech.yahoo.com/news/infoworld/20081118/tc_infoworld/117780

http://www.infoworld.com/article/07/05/07/javafx-javaone_1.html



RE: [flexcoders] Re: Flex Books - Detailed/Nitty-Gritty

2008-09-26 Thread Chet Haase

Anyways, I guess coming from Swing there are books (such as Filthy
Rich Clients, one author Chet Haase works for Adobe now) which cover

Yeah, I heard that rumor as well...

lots of neat tricks, details, expert type info. That's what I was
sort of wondering about.

To be fair, Filthy Rich Clients was written when Java/Swing/2D was pretty 
mature. At the time, the only other Swing books available just covered the 
basics. Flex is newer, so maybe the advanced books or books covering specific 
niche topics about Flex aren't there yet because most people are still getting 
into it. On the other hand, it's a very approachable platform, so it doesn't 
take too much of an intro to get you to a place where you can dive in.

It is worth checking out some of the blogs and learning sites out there; it's 
not as easy as having it collected in a table of contents, but there's some 
nice deep topics covered out there, both for AS3/Flash development in general 
and for Flex in particular.

Chet.


--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Samuel 
Colak [EMAIL PROTECTED] wrote:


 This strikes me a bit odd - what do people think Flex is ? It is
 simply a tool
 for AS3 development - or do people think this is a RAD tool like VB
 where everything
 is just point and click with no code ?

 Craig - unfortunately the actual best book is the Adobe online
 tutorials and API
 reference - its not terribly difficult to pick up once you have an
 understanding or
 background in C# or Java. If you are new to the development scene,
 then obviously
 flex will be rather more daunting - but it is worthwhile.

 On Sep 26, 2008, at 12:43 PM, cwicky99 wrote:

  I'm looking for one or more books to really dive into Flex (and
  perhaps AS3). I know the basics and have been using it for a while,
  but I really want to get into the advanced topics and the details for
  some serious Flex development. Most of the books I've seen all seem
  to have the some Table of Contents covering very basic stuff.
 
  Is there anything out there that covers all the details (you know
  sometimes when you read a blog, or watch a videocast you find out
  about a little nugget of information you had never heard of)?
 
  Thanks!
 
 
 




RE: [flexcoders] second time image is not appearing

2008-09-22 Thread Chet Haase
I don’t think your reset function does what you want it to – it sets the source 
path to the Image to null. That will make the image invisible … but you’ll 
never see it again without setting the source path back to something 
reasonable. Try toggling the visible flag instead…

Chet.


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of NATA 
RAJAN
Sent: Monday, September 22, 2008 8:55 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] second time image is not appearing

Hi
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute
mx:TextArea x=154 y=92 id=t1 height=27/
mx:Script

![CDATA[
import mx.controls.Alert;
import mx.controls.Image;
import mx.controls.Button;

public function hello():void
{
t2.text=t1.text;
}
public function hi():void
{
t1.text=;
t2.text=;
}
public function bclick1(event:Event):void
{

//img.visible=img.source;
if((img.visible)==false)
{
Alert.show(testing);
img.v! isible=true
}

}
public function rst():void
{
img.source=;
}
]]
/mx:Script
mx:Button x=95 y=226 label=submit click=hello()/
mx:Label x=48 y=92 text=text1 width=60 height=44/
mx:Label x=48 y=169 text=text2/
mx:TextInput x=154 y=167 id=t2/
mx:Button x=201 y=226 label=cancel click=hi()/
mx:Button x=301 y=226 label=image  click=bclick1(event)/
mx:Image x=363 y=76 width=81 height=80 id=img autoLoad=true 
visible=false
mx:sourcescooby.jpeg/mx:source
/mx:Image
mx:Button x=201 y=277 label=Reset click=rst()/
 ! ;   /mx:Application

when click first time image button the image will appear then i click reset 
button means the image button will disappear . if am clicking again the image 
button will not be appear
Help me plz..

Note : i attached my image
regards
Natarajan





Unlimited freedom, unlimited storage. Get it 
nowhttp://in.rd.yahoo.com/tagline_mail_2/*http:/help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/



RE: [flexcoders] Looking for examples tutorials code to learn how to draw on a canvas

2008-09-19 Thread Chet Haase
Mark,

I posted a tutorial a few months ago called TopDrawer that showed how to create 
a simple vector-drawing application. Parts 2 and 3 show the details of turning 
mouse events into drawn shapes on the canvas.


http://graphics-geek.blogspot.com/2008/03/finally-some-code-top-drawer-part-i.html
http://graphics-geek.blogspot.com/2008/03/top-drawer-part-ii.html
http://graphics-geek.blogspot.com/2008/03/top-drawer-part-iii-taking-shape.html

video versions:
http://graphics-geek.blogspot.com/2008/06/video-top-drawer-part-i.html
http://graphics-geek.blogspot.com/2008/06/video-top-drawer-parts-ii-iii.html


Chet.


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
oneproofdk
Sent: Friday, September 19, 2008 5:33 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Looking for examples tutorials code to learn how to draw 
on a canvas


Hi guys

I am looking to make a Flex3 app. where I can draw on a image.

Is there any good tutorials examples etc. out there - I havent really
been able to find any.

I found a Flash component ($199) that does the trick - but I want to
go Flex :-)
http://www.flashcomguru.com/components/whiteboard/

Thanks for any info you can share !

//Mark



RE: [flexcoders] Note to someone at Adobe who is in charge of documentation

2008-09-12 Thread Chet Haase
Jason,

I know this wasn't really your point, which was about having better docs and 
not the TweenEffect API specifically, but for what it's worth: the new effects 
for the next release of Flex, along with the Animation class (which is used 
instead of Tween), avoid the use of Function handles for easing and update/end 
handlers. Instead, we use interfaces for easing (and for type interpolation, a 
new concept in the effects). And events are sent through event handlers. 
Hopefully this all makes it more explicit what's happening to whom and what 
developers need to know about it...

Chet.


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Pan 
Troglodytes
Sent: Thursday, September 11, 2008 9:32 AM
To: flexcoders
Subject: [flexcoders] Note to someone at Adobe who is in charge of documentation

Hopefully, someone who reads this can maybe forward it or mention it to someone 
who is in the documentation department.

My biggest problem with the documentation is when it comes to function 
signatures.  Unfortunately in ActionScript, function signatures are not 
typeable.  If I was using Delphi, I could define

TMyEventCallback = function (param1: String, param2: Integer):Boolean;

So properties always just take a Function and it's up to the developer to 
figure out what the function should look like.  Okay, I can deal with that, 
given proper documentation.  But so many times in the docs, no function 
signature is listed.  I understand that it's hard to create docs while the SDK 
is still under development, however there are plenty of examples of it in code 
that shipped with 2.0.

For example, from TweenEffect:
easingFunction

property

public var easingFunction:Function../../Function.html = null

The easing function for the animation. The easing function is used to 
interpolate between the initial value and the final value. A trivial easing 
function would simply do linear interpolation, but more sophisticated easing 
functions create the illusion of acceleration and deceleration, which makes the 
animation seem more natural.

If no easing function is specified, an easing function based on the Math.sin() 
method is used.

The easing function follows the function signature popularized by Robert 
Penner. The function accepts four arguments. The first argument is the current 
time, where the animation start time is 0. The second argument is the initial 
value at the beginning of the animation (a Number). The third argument is the 
ending value minus the initial value. The fourth argument is the duration of 
the animation. The return value is the interpolated value for the current time. 
This is usually a value between the initial value and the ending value.

The value of this property must be a function object.

Flex includes a set of easing functions in the mx.effects.easing package.

This documentation is strange in that a paragraph is dedicated to describing 
the function signature, when just putting a

  function (currentTime:Number, startValue:Number, 
endValueMinusStartValue:Number, duration:Number):Number

alone would have been far more useful than the whole paragraph.  I'm not saying 
to ditch the paragraph, but a code examples is almost always preferable.  
Especially since that paragraph forgot to specify that the last two params and 
teh return param should be a Number.  This was inferable from context in this 
case, but it is not always.  These omissions tend to send me on a code hunt, 
looking for some place in the SDK where the function is called.  For 
easingFunction, this was quite a bit of digging until I finally found 
defaultEasingFunction in Tween.as.


I could put this in as a bug/enhancement, but it just seems like that falls 
short.  I'd really just like to see more of a focus on doing it properly the 
first time and possibly doing a review of all documentation that mentions a 
property or method that involves a type Function.

--
Jason



[flexcoders] Flex4 animation: try it out

2008-09-10 Thread Chet Haase
Hey everyone,

I finally got around to joining the group. I figured it's cool to be 
fashionably late. Now, to sit back and watch my inbox fill up...

I don't know if anyone made it over to my blog yesterday, but I posted a demo 
library of some of the animation features that we're working on for the next 
version of Flex. I specifically carved it out from Flex and made a pure AS3 
library (10k), just to make it easier for people to try out.

What I'm really after here is input on what you think, whether you think 
anything is missing, and whether you have any problems with it. So please check 
it out if you're animation-inclined, and comment on the blog to let me know 
(responses here are fine too, although the discussion is then limited to just 
flexcoders).

http://graphics-geek.blogspot.com/2008/09/flexy-flexible-as3-animation-library.html


Thanks,
Chet.
(ps: in case you need the context, I joined Adobe and the SDK group in January, 
and am focused on effects for most of this release)