RE: [flexcoders] Re: How do I convert an object to an arrayCollection?

2007-10-28 Thread Alex Harui
You are basically trying to convert data from one format to another, so
you'll have to loop through all of it.

 

My previous post contained a rough code for the recommended way of doing
what you did.  If you define an actual class with fields, you'll get
much better performance and type-safety at coding time, plus you should
keep your loop limits in a local variable.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of aceoohay
Sent: Saturday, October 27, 2007 10:41 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How do I convert an object to an
arrayCollection?

 



I found what appears to be a generic solution to my problem, but I have
a concern about performance. I hope that someone with (as my daughter
would say) some skills can point out the right way of doing this.

My approach is to create a function that will convert any object that
looks like the one in the original post to an ArrayCollection suitable
for use in a DataGrid. Here is what I came up with;

1st Create a dynamic Class like;

package
{
public dynamic class DynamicClass
{
}
}

Next create a function like this;

private function loadArrayCollection(objIn:Object):ArrayCollection
{
var acTmpArray:ArrayCollection = new ArrayCollection;
for (var i:Number = 0;i  objIn.initialData.length;i++)
{
var clTempClass:DynamicClass = new DynamicClass();
for (var j:Number = 0;j  objIn.columnNames.length;j++)
{
clTempClass[objIn.columnNames[j]] =
objIn.initialData[i][j];
}
acTmpArray.addItem(clTempClass);
}
return acTmpArray;
}

Then we call it like this;

[Bindable] public var acPERSON:ArrayCollection = new ArrayCollection

acPERSON = loadArrayCollection(event.PERSON.serverInfo);

and voila we have an arrayCollection that looks and acts remarkably like
one created from a HTTPService result set. I still have more testing to
make sure I can access all of its properties similar to the way the
HTTPService version works.

OK, now that I am done patting myself on the back, there must be a
better way. It seems to me that this would be slow and resource
intensive, and one of the reasons I want to move towards Fluorine is
performance. Besides it just looks like a kludge.

I am very interested in hearing of better ways of doing this without
resorting to hand coding a class for every query I create.

Paul

 



RE: [flexcoders] Odd setinterval timer error

2007-10-28 Thread Alex Harui
Flex always has a timer running.  Use the profiler to see how many
timers there are and who created them.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Austin Kottke
Sent: Saturday, October 27, 2007 6:01 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Odd setinterval timer error

 

Hi,

I'm passing some xml content through the externalinterface api and I am 
getting a very odd error.

Flex parses the xml and I can get this output just fine. However, it 
seems a few milliseconds after that I get the following error:

undefined
at flash.utils::SetIntervalTimer/flash.utils:SetIntervalTimer::onTimer()
at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
at flash.utils::Timer/flash.utils:Timer::tick()

Yet, Im not running any timer on the flex movie.

Any ideas?

 



RE: [flexcoders] flash player 9.0.60

2007-10-28 Thread Alex Harui
No official release date as of yet, and you can't force an upgrade to it
either until it is officially released.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of danielvlopes
Sent: Saturday, October 27, 2007 2:47 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] flash player 9.0.60

 

Hello,

Anyone know when adobe will release flash player 9.0.60 for every user?
If i'm not wrong, i think flash player 9.0.60 only can be downloaded
from labs and in adobe site the final release is 9.0.47 

I don't know if im right, but html wrapper generated by flex builder
template only can upgrade users flashplayer for final release in adobe
site (not labs), even i specify required version is 9.0.60 it will no
be upgraded... i'm right?

Thanks.

 



Re: [flexcoders] Error with htmlText property of TextArea - Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type?

2007-10-28 Thread arpan srivastava
Hi Dan,

There is no stacktrace, this is the only thing i get. 

- Original Message 
From: Daniel Freiman [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Saturday, October 27, 2007 9:02:27 PM
Subject: Re: [flexcoders] Error with htmlText property of TextArea - Error 
#2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown 
type?










  



Can you post the stack trace from the error?

- Dan Freiman


On 10/27/07, arpan srivastava [EMAIL PROTECTED] com
 wrote:












  




Hi All,

 i am creating a rss reader for which i am using
TextArea to display RSS description which is simple html text.
Sometimes i am getting this error:

Error #2044: Unhandled IOErrorEvent: . text=Error #2124: Loaded file is an 
unknown type


I have also put a try and catch but it is not getting caught. Also, TextArea 
does not have any IOErrorEvent event. I think it is due to loading of images 
from img, it comes very randomly. Can anyone help me with this problem?


-- 
Thanks,
Arpan


 _ _ _ _ __
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

http://mail. yahoo.com 


  


























  







!--

#ygrp-mkp{
border:1px solid #d8d8d8;font-family:Arial;margin:14px 0px;padding:0px 14px;}
#ygrp-mkp hr{
border:1px solid #d8d8d8;}
#ygrp-mkp #hd{
color:#628c2a;font-size:85%;font-weight:bold;line-height:122%;margin:10px 0px;}
#ygrp-mkp #ads{
margin-bottom:10px;}
#ygrp-mkp .ad{
padding:0 0;}
#ygrp-mkp .ad a{
color:#ff;text-decoration:none;}
--



!--

#ygrp-sponsor #ygrp-lc{
font-family:Arial;}
#ygrp-sponsor #ygrp-lc #hd{
margin:10px 0px;font-weight:bold;font-size:78%;line-height:122%;}
#ygrp-sponsor #ygrp-lc .ad{
margin-bottom:10px;padding:0 0;}
--



!--

#ygrp-mlmsg {font-size:13px;font-family:arial, helvetica, clean, sans-serif;}
#ygrp-mlmsg table {font-size:inherit;font:100%;}
#ygrp-mlmsg select, input, textarea {font:99% arial, helvetica, clean, 
sans-serif;}
#ygrp-mlmsg pre, code {font:115% monospace;}
#ygrp-mlmsg * {line-height:1.22em;}
#ygrp-text{
font-family:Georgia;
}
#ygrp-text p{
margin:0 0 1em 0;}
#ygrp-tpmsgs{
font-family:Arial;
clear:both;}
#ygrp-vitnav{
padding-top:10px;font-family:Verdana;font-size:77%;margin:0;}
#ygrp-vitnav a{
padding:0 1px;}
#ygrp-actbar{
clear:both;margin:25px 0;white-space:nowrap;color:#666;text-align:right;}
#ygrp-actbar .left{
float:left;white-space:nowrap;}
.bld{font-weight:bold;}
#ygrp-grft{
font-family:Verdana;font-size:77%;padding:15px 0;}
#ygrp-ft{
font-family:verdana;font-size:77%;border-top:1px solid #666;
padding:5px 0;
}
#ygrp-mlmsg #logo{
padding-bottom:10px;}

#ygrp-vital{
background-color:#e0ecee;margin-bottom:20px;padding:2px 0 8px 8px;}
#ygrp-vital #vithd{
font-size:77%;font-family:Verdana;font-weight:bold;color:#333;text-transform:uppercase;}
#ygrp-vital ul{
padding:0;margin:2px 0;}
#ygrp-vital ul li{
list-style-type:none;clear:both;border:1px solid #e0ecee;
}
#ygrp-vital ul li .ct{
font-weight:bold;color:#ff7900;float:right;width:2em;text-align:right;padding-right:.5em;}
#ygrp-vital ul li .cat{
font-weight:bold;}
#ygrp-vital a{
text-decoration:none;}

#ygrp-vital a:hover{
text-decoration:underline;}

#ygrp-sponsor #hd{
color:#999;font-size:77%;}
#ygrp-sponsor #ov{
padding:6px 13px;background-color:#e0ecee;margin-bottom:20px;}
#ygrp-sponsor #ov ul{
padding:0 0 0 8px;margin:0;}
#ygrp-sponsor #ov li{
list-style-type:square;padding:6px 0;font-size:77%;}
#ygrp-sponsor #ov li a{
text-decoration:none;font-size:130%;}
#ygrp-sponsor #nc{
background-color:#eee;margin-bottom:20px;padding:0 8px;}
#ygrp-sponsor .ad{
padding:8px 0;}
#ygrp-sponsor .ad #hd1{
font-family:Arial;font-weight:bold;color:#628c2a;font-size:100%;line-height:122%;}
#ygrp-sponsor .ad a{
text-decoration:none;}
#ygrp-sponsor .ad a:hover{
text-decoration:underline;}
#ygrp-sponsor .ad p{
margin:0;}
o{font-size:0;}
.MsoNormal{
margin:0 0 0 0;}
#ygrp-text tt{
font-size:120%;}
blockquote{margin:0 0 0 4px;}
.replbq{margin:4;}
--







__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[flexcoders] framerate bug of flex.

2007-10-28 Thread icykorpio
hi everyone,

many times I encounter this kind of situation.

when I change the framerate to a higher number, say 60. there is some 
flicker on some graphics code(ex: switch image etc.). however, if I low 
the framerate to 10-30. everything is smooth.

I guess if I set the framerate to a number the CPU can't catch up, flex 
will do some special things. I dunno.

Any ideas?

Regards
icykorpio





[flexcoders] Getting Debugger window when running flex application

2007-10-28 Thread essuark
I just installed the latest beta. When I run (clicking the play button 
NOT the debug button), I get the dialog box that says Where is the 
debugger or host application running? with radio buttons saying 
localhost or other machine. Actually debugging in debugging mode works 
fine, just not normally running the application through the IDE. Has 
anyone seen this? 

thanks
Ralph



[flexcoders] Re: flash player 9.0.60

2007-10-28 Thread danielvlopes
Hi Alex, thanks for answer, you think can take long?

Thanks, bye.

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

 No official release date as of yet, and you can't force an upgrade to it
 either until it is officially released.
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of danielvlopes
 Sent: Saturday, October 27, 2007 2:47 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] flash player 9.0.60
 
  
 
 Hello,
 
 Anyone know when adobe will release flash player 9.0.60 for every user?
 If i'm not wrong, i think flash player 9.0.60 only can be downloaded
 from labs and in adobe site the final release is 9.0.47 
 
 I don't know if im right, but html wrapper generated by flex builder
 template only can upgrade users flashplayer for final release in adobe
 site (not labs), even i specify required version is 9.0.60 it will no
 be upgraded... i'm right?
 
 Thanks.





Re: [flexcoders] Re: How to set Script time limit in Flex 2 (or 3)?

2007-10-28 Thread Paul Decoursey
I had thought that too, but think about it, if you have a script that  
runs for a minute users are not going to be happy. You need to break  
that up into smaller parts so that the UI can update and the user  
doesn't think it's broken.  In fact I like the default of 15 seconds,  
it helps me to regulate myself so I don't have long periods of  
what's going on?...



On Oct 27, 2007, at 10:22 PM, icykorpio wrote:

 the 60 seconds time limit is really silly!!!



 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Search Archives: http://www.mail-archive.com/flexcoders% 
 40yahoogroups.com
 Yahoo! Groups Links






Re: [flexcoders] Getting Debugger window when running flex application

2007-10-28 Thread Paul Decoursey
I think that this is because the beta player installs to a different  
file than the official release.  I think that flex is checking for  
the official release and doesn't find it.  I don't think there is a  
way to turn off this warning, at least I haven't found one.  I've  
reverted back to the official release anyway, I didn't want to  
develop against something that we didn't know when it would be released.


On Oct 28, 2007, at 7:58 AM, essuark wrote:

 I just installed the latest beta. When I run (clicking the play button
 NOT the debug button), I get the dialog box that says Where is the
 debugger or host application running? with radio buttons saying
 localhost or other machine. Actually debugging in debugging mode works
 fine, just not normally running the application through the IDE. Has
 anyone seen this?

 thanks
 Ralph



 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Search Archives: http://www.mail-archive.com/flexcoders% 
 40yahoogroups.com
 Yahoo! Groups Links






[flexcoders] Re: Deep binding with Cairngorm question

2007-10-28 Thread ben.clinkinbeard
I think maybe you're confused about what final is used for.
http://livedocs.adobe.com/flex/201/langref/statements.html#final

HTH,
Ben


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

 Could you declare the productList final and force future modifiers 
 to call removeAll() instead of creating a new one?
 
 --- In flexcoders@yahoogroups.com, dbronk dbronk@ wrote:
 
  Thank you very much and this did help.  Thought I'd reply what I 
 found
  to work in case you were interested.
  
  First, I guess because my Product class is declared as Bindable, I
  didn't have to call prodList.itemUpdated(myProduct) which was nice
  since other objects that update myProduct shouldn't have to know 
 where
  it is stored.
  
  Second, swapping my mx:Binding with adding a listener on
  CollectionEvent.COLLECTION_CHANGE definitely did the trick, but with
  one bad consequence.  If somewhere along the way code was written
  prodList = new ArrayCollection, it broke.  My solution to that was 
 to
  add back the mx:Binding, but when that fires, it simply runs a
  function that reestablishes the event listener on
  CollectionEvent.COLLECTION_CHANGE.  Now it seems to work no matter 
 how
  I set the list.
  
  Hope that made sense and thanks again.
  
  Dale
  
  --- In flexcoders@yahoogroups.com, ben.clinkinbeard
  ben.clinkinbeard@ wrote:
  
   Never used the Binding tag so I can't say for certain why adding 
 an
   item isn't firing your binding. I would think it should but I 
 don't
   know what kind of listener is being set up by Binding. As far as
   updating an attribute on a Product, you'll want to call
   prodList.itemUpdated(myProduct) afterwards but again I can't 
 guarantee
   it will work with Binding.
   
   If you set up a listener in AS for 
 CollectionEvent.COLLECTION_CHANGE
   then that approach should definitely work and adding an item to 
 the
   collection will fire the binding as well.
   
   HTH,
   Ben
   
   
   --- In flexcoders@yahoogroups.com, dbronk dbronk@ wrote:
   
I have a VO:

[Bindable]
public class Product
{
public var productName : String;
// several more attributes here
}

I place a large number of Products in my Cairngorm Singleton
SellModelLocator in var productList : ArrayCollection;

The entire SellModelLocator is declared Bindable.  In one of my 
 mxml
views I have the following:

mx:Binding source=SellModelLocator.getInstance().productList
destination=refreshFilters /

I need this binding to execute refreshFilters whenever I 
 add/remove a
Product to productList as well as when I change an attribute in 
 one of
the Products contained in productList.  How do I do this?

The follow will fire the refreshFilters:
- SellModelLocator.getInstance().productList = new 
 ArrayCollection();
- SellModelLocator.getInstance().productList =
  someOtherArrayCollection;

The following will NOT fire the refreshFilters:
- SellModelLocator.getInstance().productList.addItem( new 
 Product() );
-
   
  Product(SellModelLocator.getInstance().productList.getItemAt
 (0)).status
= ACTIVE;

Any help on how to do a deep bind would be appreciated.

Thanks,
Dale
   
  
 





[flexcoders] removechild and addchild cause flickering , help~

2007-10-28 Thread icykorpio
hi ,

here is the simple code 

var image1:Image;
var image2:Image;

public function init():void
{
image1 = new Image();
image1.x = image1.y = 0;
image1.width = image1.height = 200;

image1.source = U:\\6.jpg;

image2 = new Image();
image2.source = U:\\5.jpg;
image2.x = image2.y = 0;
image2.width = image2.height = 200;

this.addChild(image1);

}

public function onclick(event:Event):void
{
this.removeChild(image1);
this.addChild(image2);
}

when i click the button to switch the two image, handled bythe 
onclick function. I will notice a very anoying flickering.

so i can't remove and add child in one frame?

how the redraw system works...

Thanks for any info.

Best regards
yinan





[flexcoders] Re: removechild and addchild cause flickering , help~

2007-10-28 Thread icykorpio
by flickering, i mean there is a time between the change, the 
background show up. then the second iamge appear.



[flexcoders] Re: removechild and addchild cause flickering , help~

2007-10-28 Thread icykorpio
i find only the first time i do the switch, the flicker appear.

seems any UIComponent the first time be drawn needs two frames to show 
up. 



Re: [flexcoders] Swapping color from Bitmap

2007-10-28 Thread Claudia Barnal
Thanks, I'll look into this.

On 10/27/07, Bailey [EMAIL PROTECTED] wrote:

   Alex probably meant BitmapData.threshold()

 Anyways perhaps this actionscript example might help you
 http://www.sephiroth.it/tutorials/flashPHP/thresold/

 On 10/27/07, Alex Harui [EMAIL PROTECTED] wrote:
 
 Maybe BitmapData.threshhold()
 
 
   --
 
  *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of
  *Claudia Barnal
  *Sent:* Friday, October 26, 2007 6:26 PM
  *To:* flexcoders@yahoogroups.com
  *Subject:* [flexcoders] Swapping color from Bitmap
 
 
 
  Hi there,
 
  I'm told it is possible to swap a color value from a Bitmap in Flex.
 
  Say for example I want to change all the pixels that have the red
  0xFF value to any other color value (ex 0xF94A3C), what would it
  take?
 
  Are you aware of any examples/tutorials I can be pointed to?
 
  Thanks,
  Claudia
 
 
  



Re: [flexcoders] Changing the width to 100%

2007-10-28 Thread Paul Decoursey

try percentWidth verses witdh


On Oct 28, 2007, at 8:36 AM, George Georgiou wrote:


Hi there,

This is a very simple but I can't get it work. I have a panel and I  
want to change it's with to 100% by means of ActionScript. Here's  
what I do:


 public function changeWidth():void {
 mainPanel.width = 100%;
}

where mainPanel if of course the ID of my panel.

I get an error like:  semicolon is unexpected. I have tried using  
mainPanel.width=100%; but this does not work also because .width  
is of type integer.


Any ideas on how to achieve this?

thanks,
George






Re: [flexcoders] Error with htmlText property of TextArea - Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type?

2007-10-28 Thread Daniel Freiman
Ok, if you're getting this from an rss feed then you're not going to like
this.  Also this solution uses mx_internal.  If you don't know what that is,
it's a set of methods/properties, that adobe says may change so they should
be used with extreme care because your code might break on updates.
However, in this case we're using it once to avoid creating a subclass so I
think it's a fair trade.


import mx.core.mx_internal;
use namespace mx_internal; // this line should be right after the import
statements.
...
textArea.htmlText = rssText;
textArea.validateProperties(); // initializes image loaders
var textField:UITextField = textArea.getTextField(); // mx_internal line to
get textField of TextArea
for (each imageID in rssText) { // how you actually implement this psuedo
code line depends on the rssText you already have
  var loader:Loader = textField.getImageReference(imageID) as Loader;
  var loaderInfo:LoaderInfo = loader.contentLoaderInfo;
  if (loaderInfo.bytesLoaded != loaderInfo.bytesTotal) {  // it would be
pointless to add listeners to loaders that have completed
 loaderInfo.addEventListener(IOErrorEvent.IO_ERROR,
imageLoaderErrorListener); // you might want to use weakReference here for
memory management if it works.
   }
}

public function imageLoaderErrorListener(event:IOErrorEvent):void {
   // inform user if you want.
}

- Dan Freiman

On 10/28/07, arpan srivastava [EMAIL PROTECTED] wrote:

   Hi Dan,

 There is no stacktrace, this is the only thing i get.

 - Original Message 
 From: Daniel Freiman [EMAIL PROTECTED]
 To: flexcoders@yahoogroups.com
 Sent: Saturday, October 27, 2007 9:02:27 PM
 Subject: Re: [flexcoders] Error with htmlText property of TextArea -
 Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an
 unknown type?

  Can you post the stack trace from the error?

 - Dan Freiman

 On 10/27/07, arpan srivastava [EMAIL PROTECTED] com
 [EMAIL PROTECTED] wrote:
 
Hi All,
 
   i am creating a rss reader for which i am using TextArea to display RSS
  description which is simple html text. Sometimes i am getting this error:
 
  Error #2044: Unhandled IOErrorEvent: . text=Error #2124: Loaded file is
  an unknown type
 
  I have also put a try and catch but it is not getting caught. Also,
  TextArea does not have any IOErrorEvent event. I think it is due to
  loading of images from img, it comes very randomly. Can anyone help me
  with this problem?
 
  --
  Thanks,
  Arpan
 
   _ _ _ _ __
  Do You Yahoo!?
  Tired of spam? Yahoo! Mail has the best spam protection around
  http://mail. yahoo.com http://mail.yahoo.com
 
 


 __
 Do You Yahoo!?
 Tired of spam? Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com

  



[flexcoders] Re: Getting Debugger window when running flex application

2007-10-28 Thread essuark
thanks... how does one revert back to the older flash player?

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

 I think that this is because the beta player installs to a 
different  
 file than the official release.  I think that flex is checking for  
 the official release and doesn't find it.  I don't think there is 
a  
 way to turn off this warning, at least I haven't found one.  I've  
 reverted back to the official release anyway, I didn't want to  
 develop against something that we didn't know when it would be 
released.
 
 
 On Oct 28, 2007, at 7:58 AM, essuark wrote:
 
  I just installed the latest beta. When I run (clicking the play 
button
  NOT the debug button), I get the dialog box that says Where is 
the
  debugger or host application running? with radio buttons saying
  localhost or other machine. Actually debugging in debugging mode 
works
  fine, just not normally running the application through the IDE. 
Has
  anyone seen this?
 
  thanks
  Ralph
 
 
 
  --
  Flexcoders Mailing List
  FAQ: 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Search Archives: http://www.mail-archive.com/flexcoders% 
  40yahoogroups.com
  Yahoo! Groups Links
 
 
 





[flexcoders] List change event to BubbleChart

2007-10-28 Thread picklzzz
I'm a newbie and have, what I think is, a simple task:

I have a BubbleChart populated from an ArrayCollection consisting
of fields name, x, y, and size. I populate an adjoining List
with the name field. I would like to be able to select on, possibly
multiple, names in the List and have the bubble in the bubblechart get
highlighted (perhaps by glowing or having the other bubbles alpha value
increase so they aren't as prominent)

I can't figure out whether a filter is necessary (I already have another
filter for my arraycollection) or there's another way.

Any help would be greatly appreciated.

 



[flexcoders] Tween Motion along a path

2007-10-28 Thread snowjunkie73
At Adobe Max 2007 I went to a session on creating custom components in
Flex.  The example component used in the session was a custom carousel
component where objects would tween along a circular path.  The source
for this example class was never released, but I am fairly certain
that the math for the path was done entirely in Flex, and it was not
using a Flash CS3 generated path.  The movement was nice and smooth.

I'm trying to do my own tweening along a circular path but in a flat
2d manner.  I've done all the math in action script 3 to find the
circular path but I am having trouble getting objects to move smoothly
along the path.  Basically I pick a number of points along the path
and use Move effects from point to point.  The more points I pick the
closer it appears to be on a true circle.  I've tried both manually
kicking off each individual move effect from the effect end event and
also putting the move effects in a sequence effect.  Both methods
cause the motion to be either extremely slow (if I set each move
duration to be large) or pretty jerky (if I set the move duration to
be very small like 0-2).  It appears that there is a pause between the
end of each move effect before the next move effect starts.

The reason I want to do it all in code is that I want to be able to
vary the radius of my circular path dynamically.  Anyone have ideas on
how I can get smoother motion along my path?  Thanks in advance.



Re: [flexcoders] Changing the width to 100%

2007-10-28 Thread Bailey
Hi George,
yeah the width property will only take an integer so you must use the
percentProperty to set a percent.
So something like this would be fine~

public function changeWidth():void
{
 mainPanel.percentWidth = 100;
}



On 10/28/07, George Georgiou [EMAIL PROTECTED] wrote:

   Hi there,

 This is a very simple but I can't get it work. I have a panel and I want
 to change it's with to 100% by means of ActionScript. Here's what I do:

  public function changeWidth():void {
  mainPanel.width = 100%;
 }

 where mainPanel if of course the ID of my panel.

 I get an error like:  semicolon is unexpected. I have tried using
 mainPanel.width=100%; but this does not work also because .width is of
 type integer.

 Any ideas on how to achieve this?

 thanks,
 George


  



Re: [flexcoders] flash player 9.0.60

2007-10-28 Thread eoptica



correct.

 9.0.60 is a beta, i.e. not ready for primetime. In fact the beta is  
now... 9.0.64?



-radley


On Oct 27, 2007, at 2:46 PM, danielvlopes wrote:


Hello,

Anyone know when adobe will release flash player 9.0.60 for every  
user?

If i'm not wrong, i think flash player 9.0.60 only can be downloaded
from labs and in adobe site the final release is 9.0.47 

I don't know if im right, but html wrapper generated by flex builder
template only can upgrade users flashplayer for final release in adobe
site (not labs), even i specify required version is 9.0.60 it will no
be upgraded... i'm right?

Thanks.







[flexcoders] POST vs GET vs SEND ...not the same inside Flex

2007-10-28 Thread i.yoho
The more I play with this, the more I am convinced that it is acting
wrong because of Flex. I am watching the Apache server access.log as
the data goes by. And I just can't figure this out. My apologies for
the cross-post with Flash-Tiger group but I haven't heard anything and
thought it might be more appropriate here if Flex is causing the error.

I am working from the example in the Actionscript 3 cookbook chapter
20.13 trying to learn how to properly send XML data to a server-side
script. I have tried this a couple ways but haven't been able to get
past xml parsing errors with the basic HTTPService send. And to
compound matters, I am trying to learn Flex at the same time.

This code is from chapter 20.13 but to get any data to pass I have to
switch it from a .POST to a .GET. From what I have read, the .POST is
the right way. Has anybody been through this? Any advice greatly
appreciated.


var request:URLRequest = new URLRequest( /saveResults.php );
// Set the data property to the dataToSave XML instance to send
the XML
// data to the server
request.data= dataToSave;
// Set the contentType to signal XML data being sent
request.contentType = text/xml;
// Use the post method to send the data
request.method = URLRequestMethod.POST;

// Create a URLLoader to handle sending and loading of the XML data
var loader:URLLoader = new URLLoader( );
// When the server response is finished downloading, invoke
handleResponse

loader.addEventListener( Event.COMPLETE, handleResponse );
// Finally, send off the XML data to the URL
loader.load( request );
}

Thanks,
Imogene



[flexcoders] Transition changing z-order before transition effect starts

2007-10-28 Thread Daniel Freiman
I'm working with transitions. I'm trying apply an effect to a component,
then removing children, replacing children, and then applying another effect
to the component.  This is working except that before the first effect
plays, the child indexes/z-order get all screwed up.  Since I'm using a
ControlBar\HBox, this looks as if the children are randomly switching places
before the transition.  Anyone have any idea what's going on here?  (Moxie
B2).

?xml version=1.0 encoding=utf-8?
mx:ControlBar xmlns:mx=http://www.adobe.com/2006/mxml;
mx:Script
![CDATA[
import mx.effects.WipeLeft;
public function radioChange(event:Event):void {
//dispatchEvent(new Event((TimeSet.selectedValue.toString() as
String).toLowerCase()));
}

public function configure(event:MouseEvent):void {
currentState = EditState;
trace(configure);
}

public function unConfigure(event:MouseEvent):void {
currentState = ;
trace(unconfigure);
}
]]
/mx:Script
mx:states
mx:State name=EditState
mx:RemoveChild target={button1}/
mx:RemoveChild target={vrule1}/
mx:RemoveChild target={radiobutton1}/
mx:RemoveChild target={radiobutton2}/
mx:RemoveChild target={radiobutton3}/
mx:RemoveChild target={vrule2}/
mx:RemoveChild target={radiobutton4}/
mx:RemoveChild target={radiobutton5}/
mx:RemoveChild target={vrule3}/
mx:RemoveChild target={label1}/
mx:RemoveChild target={datefield1}/
mx:AddChild position=lastChild
mx:Button id=unconfigureButton label=Return to Store
Front click=unConfigure(event);/
/mx:AddChild
mx:AddChild position=lastChild
mx:PopUpMenuButton id=addZoneButton label=Add Zone/
/mx:AddChild
mx:AddChild position=lastChild
mx:Button id=removeZoneButton label=Remove Current
Zone/
/mx:AddChild
mx:AddChild position=lastChild
mx:Button id=addPositionButton label=Add Position/
/mx:AddChild
mx:AddChild position=lastChild
mx:PopUpMenuButton id=removePositionButton label=Remove
Position/
/mx:AddChild
mx:AddChild position=lastChild 
mx:PopUpMenuButton id=addCategoryButton label=Add
Category/
/mx:AddChild
mx:AddChild position=lastChild
mx:PopUpMenuButton id=removeCategoryButton label=Remove
Category/
/mx:AddChild
/mx:State
/mx:states

mx:transitions
mx:Transition fromState=* toState=EditState
mx:Sequence targets={[button1, vrule1, radiobutton1,
radiobutton2, radiobutton3, vrule2, radiobutton4, radiobutton5, vrule3,
label1, datefield1, unconfigureButton, addZoneButton, removeZoneButton,
addPositionButton, removePositionButton, addCategoryButton,
removeCategoryButton]} 
mx:WipeLeft showTarget=false target={this}
duration=5000/
mx:RemoveChildAction/
mx:AddChildAction/
mx:WipeRight showTarget=true target={this}/
/mx:Sequence
/mx:Transition
mx:Transition fromState=EditState toState=*
mx:Sequence targets={[button1, vrule1, radiobutton1,
radiobutton2, radiobutton3, vrule2, radiobutton4, radiobutton5, vrule3,
label1, datefield1, unconfigureButton, addZoneButton, removeZoneButton,
addPositionButton, removePositionButton, addCategoryButton,
removeCategoryButton]} 
mx:WipeLeft showTarget=false target={this}
duration=5000/
mx:RemoveChildAction/
mx:AddChildAction/
mx:WipeRight showTarget=true target={this}/
/mx:Sequence
/mx:Transition
/mx:transitions

mx:Button label=Configure Store Front click=configure(event)
id=button1/
mx:VRule minHeight=0 height=22 alpha=0.5 id=vrule1/
mx:RadioButton label=Breakfast groupName=TimeSet selected=true
id=radiobutton1/
mx:RadioButton label=Lunch groupName=TimeSet id=radiobutton2/
mx:RadioButton label=Night groupName=TimeSet id=radiobutton3/
mx:VRule minHeight=0 height=22 alpha=0.5 id=vrule2/
mx:RadioButton label=Approved groupName=viewableSet selected=true
id=radiobutton4/
mx:RadioButton label=Working groupName=viewableSet
id=radiobutton5/
mx:VRule minHeight=0 height=22  alpha=0.5 id=vrule3/
mx:Label text=Last Approved id=label1/
mx:DateField editable=false mouseEnabled=false
mouseChildren=false id=datefield1/
/mx:ControlBar


RE: [flexcoders] Re: How to set Script time limit in Flex 2 (or 3)?

2007-10-28 Thread Tracy Spratt
I also have a use case that makes this limit very hurtful.  Setting a 60
second limit because you think that users might be unhappy arrogantly
assumes you know what my app is doing.

 

What if FlexBuilder blew up anytime your project took longer than 60
seconds to compile?  Would you be happy?

 

That is analogous to what I am doing, which is generating very complex
code.  Theoretically, perhaps,  this generation should be done on the
server, but it would take me 10 weeks to reimplement my logic in some
other language.  So my one client that has this massively complicated
application is stuck at FP7 (for my admin IDE, anyway ) until I can find
10 spare weeks.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Paul Decoursey
Sent: Sunday, October 28, 2007 9:25 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: How to set Script time limit in Flex 2
(or 3)?

 

I had thought that too, but think about it, if you have a script that 
runs for a minute users are not going to be happy. You need to break 
that up into smaller parts so that the UI can update and the user 
doesn't think it's broken. In fact I like the default of 15 seconds, 
it helps me to regulate myself so I don't have long periods of 
what's going on?...

On Oct 27, 2007, at 10:22 PM, icykorpio wrote:

 the 60 seconds time limit is really silly!!!



 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 
 Search Archives: http://www.mail-archive.com/flexcoders%
http://www.mail-archive.com/flexcoders%25  
 40yahoogroups.com
 Yahoo! Groups Links




 



RE: [flexcoders] POST vs GET vs SEND ...not the same inside Flex

2007-10-28 Thread Tracy Spratt
Use HTTPService.  Don't mess with contentType, but send your xml as a
string in a name=value pair. Set the method as post.  Set
resultFormat=e4x.  It will work without any problems,
Tracy

Sample code using HTTPService, e4x, handler function to populate a list
item.  
Also shows usage of AsyncToken.

The DataGrid tag:
mx:DataGrid id=dg dataProvider={_xlcMyListData} .../


The HTTPService tag:
mx:HTTPService id=service resultFormat=e4x result=onResult(event)
fault=/

Script block declaration:
import mx.rpc.Events.ResultEvent;
[Bindable]private var _xlcMyListData:XMLListCollection;

Invoke send:
var oRequest:Object = new Object();
oRequest.Arg1 = value1;
var callToken:AsyncToken = service.send(oRequest);
token.callId = myQuery1;

Result Handler function:
private function onResult(oEvent:ResultEvent):void  {
  var xmlResult:XML = XML(event.result);//converts
result Object to XML. can also use as operator
  var xlMyListData:XMLList = xmlResult.myListData;  //depends on xml
format, is row data
  _xlcMyListData = new XMLListCollection(xlMyListData); //wrap the
XMLList in a collection
  trace(_xlcMyListData.toXMLString());  //so you can see
exactly how to specify dataField or build labelFunction
  var callToken:AsyncToken = oEvent.token;
  var sCallId = callToken.callId;   //myQuery1
  switch(sCallId)  {//Process the
result conditionally
case myQuery1:
  doQuery2();   //do whatever
  break;
... 
  }
}//onResult


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of i.yoho
Sent: Sunday, October 28, 2007 2:16 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] POST vs GET vs SEND ...not the same inside Flex

The more I play with this, the more I am convinced that it is acting
wrong because of Flex. I am watching the Apache server access.log as
the data goes by. And I just can't figure this out. My apologies for
the cross-post with Flash-Tiger group but I haven't heard anything and
thought it might be more appropriate here if Flex is causing the error.

I am working from the example in the Actionscript 3 cookbook chapter
20.13 trying to learn how to properly send XML data to a server-side
script. I have tried this a couple ways but haven't been able to get
past xml parsing errors with the basic HTTPService send. And to
compound matters, I am trying to learn Flex at the same time.

This code is from chapter 20.13 but to get any data to pass I have to
switch it from a .POST to a .GET. From what I have read, the .POST is
the right way. Has anybody been through this? Any advice greatly
appreciated.

var request:URLRequest = new URLRequest( /saveResults.php );
// Set the data property to the dataToSave XML instance to send
the XML
// data to the server
request.data= dataToSave;
// Set the contentType to signal XML data being sent
request.contentType = text/xml;
// Use the post method to send the data
request.method = URLRequestMethod.POST;

// Create a URLLoader to handle sending and loading of the XML data
var loader:URLLoader = new URLLoader( );
// When the server response is finished downloading, invoke
handleResponse

loader.addEventListener( Event.COMPLETE, handleResponse );
// Finally, send off the XML data to the URL
loader.load( request );
}

Thanks,
Imogene
 


[flexcoders] FileReference upload passing parameters in URLRequest

2007-10-28 Thread letterpigeon
Hi all,
 
I'm having this strange problem while uploading file in flex using
FileReference, that even though I set the the request attribute on the
flex side, and I verified that before I call fileRef.upload, the
URLRequest object has all the attributes I set in its data property.
 But when the request arrived on the java servlet side, the
httprequest contains no attributes at all.  Below is the code snippet
that I'm using to perform the upload, this processUpload method is
called after the user has browsed for a file, then hit upload so I'm
only registering the COMPLETE event here.  fileRef is a global
variable of type FileReference in the enclosing file.
private function processUpload(func:Function):void

{

fileRef.addEventListener(Event.COMPLETE, func);


var request:URLRequest = new
URLRequest(FileImportConfigurationSource.HOST_PORT_CONTEXT +
/FileUploadServlet);

var params:URLVariables = new URLVariables();


//Read file header data from UI input

var client:FIClient = clientList.selectedItem as FIClient;

var mnemonic:String = mnemonicList.selectedLabel;


uploadFileId = UIDUtil.createUID().toString();

params.uploadFileId = uploadFileId;

params.transmissionId = testing;


request.data = params;


fileRef.upload(request);

}

Anyone spot any wrongdoing in the above code?  Thanks.

Ban



[flexcoders] Binding to a subclass of a proxy object

2007-10-28 Thread Austin Kottke
Hi,

Here's what I'm trying to do. Load in an xml file, assign this to a 
settings singleton which extends flash_proxy and then bind to these 
properties.

Essentially:

public function setupXMLProxy( contentToProxy:XML ):void {
logger.debug( setupXMLProxy() called. )
var content:XML = contentToProxy;
   
for each( var node:XML in content.Text ) {
logger.debug(node:  + [EMAIL PROTECTED]  + ==  + node);
this[ [EMAIL PROTECTED] ] = node ;
}
 
}

The singleton proxy now has a bunch of variabels that can be referenced 
like

var myProp:String = LocaleMgr.getInstance().propertyFromXML

Which retrieves the translations.

This works.

What doesnt work is binding to these properties from other mxml files. 
My binding method in the singleton is the following:

public function bind( object:Object, propertyName:String, param:String = 
text ):void {
var w:ChangeWatcher = 
ChangeWatcher.watch(LocaleMgr.getInstance(), propertyName, null, false);
   
if (w != null)
{
var assign:Function = function(event:*):void
{
object[param] = w.getValue();
};
w.setHandler(assign);
assign(null);
}
   }

Basically I took the code from BindingUtils and stuck it in my static 
instance.

This works for a single property, but it does not work automatically if 
I assign a property to the static instance.

There is no updating occurring unless I directly reset the binding which 
defeats the purpose.

Anyone have any bright ideas on this?

Austin




   

Best,

Austin


[flexcoders] Find colors used in an image

2007-10-28 Thread Claudia Barnal
Hi,

what is a quick way to find out what colors are being used in a Bitmap
(loaded image)? As far as I know it is only possible looping through
each pixel in the bitmap.

Basically, I need to find the each color instance to create a Color
Palette/Swatch/Table for that image.

Thanks,
Claudia


[flexcoders] Triggering a function in the main application from popup window.

2007-10-28 Thread kalpkat9
Hi,

This might be a really petty question to ask, but I will great 
appreciate if someone can answer.

How can I trigger a function in my main application mxml, from a popup 
window(title window/panel) after a submit button click. (I am trying to 
change the state of my main application by clicking the submit button)

Thank you,
Kal.



[flexcoders] Trigger a function in the main applicatoin mxml from a popup window.

2007-10-28 Thread kalpkat9
Hi,

This might be a really petty question to ask, but I will greatly
appreciate if someone can answer.

How can I trigger a function in my main application mxml, from a popup
window(title window/panel) after a submit button click. (I am trying to
change the state of my main application by clicking the submit button)

Thank you,
Kal.







Re: [flexcoders] Trigger a function in the main applicatoin mxml from a popup window.

2007-10-28 Thread Bjorn Schultheiss
Listen to the closeEvent from the popup and call the function from  
the handler.


Bjorn


On 29/10/2007, at 12:10 PM, kalpkat9 wrote:


Hi,

This might be a really petty question to ask, but I will greatly
appreciate if someone can answer.

How can I trigger a function in my main application mxml, from a popup
window(title window/panel) after a submit button click. (I am  
trying to

change the state of my main application by clicking the submit button)

Thank you,
Kal.







Re: [flexcoders] Tween Motion along a path

2007-10-28 Thread Bjorn Schultheiss
I wasn't at Max, but have you seen this, http://labs.zeh.com.br/blog/? 
p=95 ?


Bjorn


On 29/10/2007, at 1:34 AM, snowjunkie73 wrote:


At Adobe Max 2007 I went to a session on creating custom components in
Flex. The example component used in the session was a custom carousel
component where objects would tween along a circular path. The source
for this example class was never released, but I am fairly certain
that the math for the path was done entirely in Flex, and it was not
using a Flash CS3 generated path. The movement was nice and smooth.

I'm trying to do my own tweening along a circular path but in a flat
2d manner. I've done all the math in action script 3 to find the
circular path but I am having trouble getting objects to move smoothly
along the path. Basically I pick a number of points along the path
and use Move effects from point to point. The more points I pick the
closer it appears to be on a true circle. I've tried both manually
kicking off each individual move effect from the effect end event and
also putting the move effects in a sequence effect. Both methods
cause the motion to be either extremely slow (if I set each move
duration to be large) or pretty jerky (if I set the move duration to
be very small like 0-2). It appears that there is a pause between the
end of each move effect before the next move effect starts.

The reason I want to do it all in code is that I want to be able to
vary the radius of my circular path dynamically. Anyone have ideas on
how I can get smoother motion along my path? Thanks in advance.







[flexcoders] Re: Trigger a function in the main applicatoin mxml from a popup window.

2007-10-28 Thread kalpkat9
Thanks for taking your time to respond, Bjorn.

I am triggering a function called submitData() from the click event of
my button inside the popup window.

private function submitData():void{
mainApp.currentState.name = secondState;
}

This doesnt seem to accomplish what I wish for (of changing the state
of my mainApp.mxml)

How is that I can access a function from my main application mxml, 
for example: changeState().

private function changeState():void{
currentState = secondState;
}

Please excuse my ignorance. Could you let me know what I am missing?

Thank you.

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

 Listen to the closeEvent from the popup and call the function from  
 the handler.
 
 Bjorn
 
 
 On 29/10/2007, at 12:10 PM, kalpkat9 wrote:
 
  Hi,
 
  This might be a really petty question to ask, but I will greatly
  appreciate if someone can answer.
 
  How can I trigger a function in my main application mxml, from a popup
  window(title window/panel) after a submit button click. (I am  
  trying to
  change the state of my main application by clicking the submit button)
 
  Thank you,
  Kal.
 
 
 





Re: [flexcoders] Re: Trigger a function in the main applicatoin mxml from a popup window.

2007-10-28 Thread Bjorn Schultheiss

Try from in the mainApp scope.


http://livedocs.adobe.com/labs/flex3/html/help.html? 
content=controls_22.html


?xml version=1.0?
!-- controls\alert\AlertIcon.mxml --
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;

mx:Script
![CDATA[
import mx.controls.Alert;
import mx.events.CloseEvent;

[Embed(source=assets/alertIcon.jpg)]
[Bindable]
public var iconSymbol:Class;

private function alertListener(eventObj:CloseEvent):void {
// Check to see if the OK button was pressed.
if (eventObj.detail==Alert.OK) {
myText.text = myInput.text;
}
}
]]
/mx:Script

mx:TextInput id=myInput
width=150
text=/
mx:Button id=myButton
label=Copy Text
click='Alert.show(Copy Text?, Alert,
Alert.OK | Alert.CANCEL, this,
alertListener, iconSymbol,  Alert.OK );'/
mx:TextInput id=myText/
/mx:Application



On 29/10/2007, at 1:56 PM, kalpkat9 wrote:


Thanks for taking your time to respond, Bjorn.

I am triggering a function called submitData() from the click event of
my button inside the popup window.

private function submitData():void{
mainApp.currentState.name = secondState;
}

This doesnt seem to accomplish what I wish for (of changing the state
of my mainApp.mxml)

How is that I can access a function from my main application mxml,
for example: changeState().

private function changeState():void{
currentState = secondState;
}

Please excuse my ignorance. Could you let me know what I am missing?

Thank you.

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

 Listen to the closeEvent from the popup and call the function from
 the handler.

 Bjorn


 On 29/10/2007, at 12:10 PM, kalpkat9 wrote:

  Hi,
 
  This might be a really petty question to ask, but I will greatly
  appreciate if someone can answer.
 
  How can I trigger a function in my main application mxml, from  
a popup

  window(title window/panel) after a submit button click. (I am
  trying to
  change the state of my main application by clicking the submit  
button)

 
  Thank you,
  Kal.
 
 
 








[flexcoders] Re: Trigger a function in the main applicatoin mxml from a popup window.

2007-10-28 Thread kalpkat9
ok, I guess this will suffice if the popup was just an alert. but the
popup window i am working on is a component by itself with datagrids
and states, so i have to trigger the with button click from this
titlewindow/popup window component. how is that i could access a
function in the mainApp.mxml from my popup custom component mxml?.
Thank you again.
(sincerely appreciate your responses).

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

 Try from in the mainApp scope.
 
 
 http://livedocs.adobe.com/labs/flex3/html/help.html? 
 content=controls_22.html
 
 ?xml version=1.0?
 !-- controls\alert\AlertIcon.mxml --
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 
  mx:Script
  ![CDATA[
  import mx.controls.Alert;
  import mx.events.CloseEvent;
 
  [Embed(source=assets/alertIcon.jpg)]
  [Bindable]
  public var iconSymbol:Class;
 
  private function alertListener(eventObj:CloseEvent):void {
  // Check to see if the OK button was pressed.
  if (eventObj.detail==Alert.OK) {
  myText.text = myInput.text;
  }
  }
  ]]
  /mx:Script
 
  mx:TextInput id=myInput
  width=150
  text=/
  mx:Button id=myButton
  label=Copy Text
  click='Alert.show(Copy Text?, Alert,
  Alert.OK | Alert.CANCEL, this,
  alertListener, iconSymbol,  Alert.OK );'/
  mx:TextInput id=myText/
 /mx:Application
 
 
 
 On 29/10/2007, at 1:56 PM, kalpkat9 wrote:
 
  Thanks for taking your time to respond, Bjorn.
 
  I am triggering a function called submitData() from the click event of
  my button inside the popup window.
 
  private function submitData():void{
  mainApp.currentState.name = secondState;
  }
 
  This doesnt seem to accomplish what I wish for (of changing the state
  of my mainApp.mxml)
 
  How is that I can access a function from my main application mxml,
  for example: changeState().
 
  private function changeState():void{
  currentState = secondState;
  }
 
  Please excuse my ignorance. Could you let me know what I am missing?
 
  Thank you.
 
  --- In flexcoders@yahoogroups.com, Bjorn Schultheiss
  bjorn.mailinglists@ wrote:
  
   Listen to the closeEvent from the popup and call the function from
   the handler.
  
   Bjorn
  
  
   On 29/10/2007, at 12:10 PM, kalpkat9 wrote:
  
Hi,
   
This might be a really petty question to ask, but I will greatly
appreciate if someone can answer.
   
How can I trigger a function in my main application mxml, from  
  a popup
window(title window/panel) after a submit button click. (I am
trying to
change the state of my main application by clicking the submit  
  button)
   
Thank you,
Kal.
   
   
   
  
 
 
 





Re: [flexcoders] Re: Trigger a function in the main applicatoin mxml from a popup window.

2007-10-28 Thread Bjorn Schultheiss

I guess you would have to consider coupling.
You could have your mainApp register as a listener to your popup.  
dispatch an event from your popup that triggers the method in your  
mainApp view.
I guess you could also register your mainApp as a 'mediator' of your  
component popup.


Normally i would use an MVC architecture and my currentState would be  
bound to a property on the model.



Bjorn



On 29/10/2007, at 2:25 PM, kalpkat9 wrote:


ok, I guess this will suffice if the popup was just an alert. but the
popup window i am working on is a component by itself with datagrids
and states, so i have to trigger the with button click from this
titlewindow/popup window component. how is that i could access a
function in the mainApp.mxml from my popup custom component mxml?.
Thank you again.
(sincerely appreciate your responses).

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

 Try from in the mainApp scope.


 http://livedocs.adobe.com/labs/flex3/html/help.html?
 content=controls_22.html

 ?xml version=1.0?
 !-- controls\alert\AlertIcon.mxml --
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;

 mx:Script
 ![CDATA[
 import mx.controls.Alert;
 import mx.events.CloseEvent;

 [Embed(source=assets/alertIcon.jpg)]
 [Bindable]
 public var iconSymbol:Class;

 private function alertListener(eventObj:CloseEvent):void {
 // Check to see if the OK button was pressed.
 if (eventObj.detail==Alert.OK) {
 myText.text = myInput.text;
 }
 }
 ]]
 /mx:Script

 mx:TextInput id=myInput
 width=150
 text=/
 mx:Button id=myButton
 label=Copy Text
 click='Alert.show(Copy Text?, Alert,
 Alert.OK | Alert.CANCEL, this,
 alertListener, iconSymbol, Alert.OK );'/
 mx:TextInput id=myText/
 /mx:Application



 On 29/10/2007, at 1:56 PM, kalpkat9 wrote:

  Thanks for taking your time to respond, Bjorn.
 
  I am triggering a function called submitData() from the click  
event of

  my button inside the popup window.
 
  private function submitData():void{
  mainApp.currentState.name = secondState;
  }
 
  This doesnt seem to accomplish what I wish for (of changing the  
state

  of my mainApp.mxml)
 
  How is that I can access a function from my main application mxml,
  for example: changeState().
 
  private function changeState():void{
  currentState = secondState;
  }
 
  Please excuse my ignorance. Could you let me know what I am  
missing?

 
  Thank you.
 
  --- In flexcoders@yahoogroups.com, Bjorn Schultheiss
  bjorn.mailinglists@ wrote:
  
   Listen to the closeEvent from the popup and call the function  
from

   the handler.
  
   Bjorn
  
  
   On 29/10/2007, at 12:10 PM, kalpkat9 wrote:
  
Hi,
   
This might be a really petty question to ask, but I will  
greatly

appreciate if someone can answer.
   
How can I trigger a function in my main application mxml, from
  a popup
window(title window/panel) after a submit button click. (I am
trying to
change the state of my main application by clicking the submit
  button)
   
Thank you,
Kal.
   
   
   
  
 
 
 








Re: [flexcoders] Tween Motion along a path

2007-10-28 Thread Doug McCune
For starters, the presentation you're referring from Michael Labriola to was
just posted online: http://blogs.digitalpri
mates.net/codeSlinger/index.cfm/2007/10/28/Max-Presentation

The basic idea that I think makes sense for you to approach the problem with
is that you want a function that lays out all your items for any given
rotation of the circle. This function doesn't do anything in terms of
animating. All it does is lays out your items given a particular rotation of
your circle. So if you have a method like:

function layoutItems(angle:Number):void {
//layout all your items here for the given angle passed in
}

then you just make sure to call that function whenever you change the
rotation of your circle. You can make that happen in a setter for a property
on your class, and then you can tween that property. Not sure if that's all
making sense. Take a look at the code from the MAX preso in the link above.
You'll see a setter for a property called currentPosition. That setter calls
invalidateDisplayList(), and in updateDisplayist he's got the code that
moves all the items to their proper positions given whatever currentPosition
has been set to.

Then what he does is tweens the currentPosition property. So he doesn't have
to have a bazillion tweens running for each of his items. He tweens a single
property, and then when that property gets set, he makes sure to re-layout
the items.

If you want to go completely overboard and learn how to do crazy stuff with
animating on paths (in 2D and in 3D) then you can read up on Jim Armstrong's
blog: http://algorithmist.wordpress.com He has tons of stuff about animating
along curves and gets into the crazy math you need. That's overkill for what
you're trying to do, but worth checking out.

Doug

On 10/28/07, Bjorn Schultheiss [EMAIL PROTECTED] wrote:

   I wasn't at Max, but have you seen this,
 http://labs.zeh.com.br/blog/?p=95 ?

 Bjorn


 On 29/10/2007, at 1:34 AM, snowjunkie73 wrote:

 At Adobe Max 2007 I went to a session on creating custom components in
 Flex. The example component used in the session was a custom carousel
 component where objects would tween along a circular path. The source
 for this example class was never released, but I am fairly certain
 that the math for the path was done entirely in Flex, and it was not
 using a Flash CS3 generated path. The movement was nice and smooth.

 I'm trying to do my own tweening along a circular path but in a flat
 2d manner. I've done all the math in action script 3 to find the
 circular path but I am having trouble getting objects to move smoothly
 along the path. Basically I pick a number of points along the path
 and use Move effects from point to point. The more points I pick the
 closer it appears to be on a true circle. I've tried both manually
 kicking off each individual move effect from the effect end event and
 also putting the move effects in a sequence effect. Both methods
 cause the motion to be either extremely slow (if I set each move
 duration to be large) or pretty jerky (if I set the move duration to
 be very small like 0-2). It appears that there is a pause between the
 end of each move effect before the next move effect starts.

 The reason I want to do it all in code is that I want to be able to
 vary the radius of my circular path dynamically. Anyone have ideas on
 how I can get smoother motion along my path? Thanks in advance.


  


Re: [flexcoders] Re: iterating across an object

2007-10-28 Thread Doug McCune
BTW, check out Josh Tynjala's writeup of some of the new stuff that's going
to be in ECMAScript:
http://www.zeuslabs.us/2007/10/28/discover-ecmascript-4-the-future-of-actionscript/

Included is Map  :)

You can read the document outlining some of the new stuff in ECMAScript 4
here: http://www.ecmascript.org/es4/spec/overview.pdf

Doug

On 10/27/07, ben.clinkinbeard [EMAIL PROTECTED] wrote:

   // iterate over strings/property names
 for(var prop:String in obj)
 {
 trace(prop +  =  + obj[prop]);
 }

 // iterate over properties
 for each(var member:Object in obj)
 {
 trace(member);
 }

 Should be more complete descriptions in the docs.

  any idea why there is no formal Map object in AS3
 Nope. Maybe ECMAScript doesn't support them? Just guessing.

 HTH,
 Ben

  



RE: [flexcoders] Re: Trigger a function in the main applicatoin mxml from a popup window.

2007-10-28 Thread Alex Harui
If changeState() was public you could call
Application.application.changeState() from the popup

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of kalpkat9
Sent: Sunday, October 28, 2007 7:56 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Trigger a function in the main applicatoin
mxml from a popup window.

 

Thanks for taking your time to respond, Bjorn.

I am triggering a function called submitData() from the click event of
my button inside the popup window.

private function submitData():void{
mainApp.currentState.name = secondState;
}

This doesnt seem to accomplish what I wish for (of changing the state
of my mainApp.mxml)

How is that I can access a function from my main application mxml, 
for example: changeState().

private function changeState():void{
currentState = secondState;
}

Please excuse my ignorance. Could you let me know what I am missing?

Thank you.

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Bjorn Schultheiss
[EMAIL PROTECTED] wrote:

 Listen to the closeEvent from the popup and call the function from 
 the handler.
 
 Bjorn
 
 
 On 29/10/2007, at 12:10 PM, kalpkat9 wrote:
 
  Hi,
 
  This might be a really petty question to ask, but I will greatly
  appreciate if someone can answer.
 
  How can I trigger a function in my main application mxml, from a
popup
  window(title window/panel) after a submit button click. (I am 
  trying to
  change the state of my main application by clicking the submit
button)
 
  Thank you,
  Kal.
 
 
 


 



RE: [flexcoders] Re: removechild and addchild cause flickering , help~

2007-10-28 Thread Alex Harui
Image loading is asynchronous and could take any number of frames on a
slow network.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of icykorpio
Sent: Sunday, October 28, 2007 8:03 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: removechild and addchild cause flickering ,
help~

 

i find only the first time i do the switch, the flicker appear.

seems any UIComponent the first time be drawn needs two frames to show 
up. 

 



RE: [flexcoders] Re: flash player 9.0.60

2007-10-28 Thread Alex Harui
I would expect it to be before or on the date of Flex 3.0

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of danielvlopes
Sent: Sunday, October 28, 2007 6:22 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: flash player 9.0.60

 

Hi Alex, thanks for answer, you think can take long?

Thanks, bye.

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Alex Harui [EMAIL PROTECTED] wrote:

 No official release date as of yet, and you can't force an upgrade to
it
 either until it is officially released.
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of danielvlopes
 Sent: Saturday, October 27, 2007 2:47 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] flash player 9.0.60
 
 
 
 Hello,
 
 Anyone know when adobe will release flash player 9.0.60 for every
user?
 If i'm not wrong, i think flash player 9.0.60 only can be downloaded
 from labs and in adobe site the final release is 9.0.47 
 
 I don't know if im right, but html wrapper generated by flex builder
 template only can upgrade users flashplayer for final release in adobe
 site (not labs), even i specify required version is 9.0.60 it will no
 be upgraded... i'm right?
 
 Thanks.


 



Re: [flexcoders] FileReference upload passing parameters in URLRequest

2007-10-28 Thread Abdul Qabiz
Note sure, but you might need to set the method in URLRequest.

request.method = URLRequestMethod.POST;

-abdul

On 10/29/07, letterpigeon [EMAIL PROTECTED] wrote:

   Hi all,

 I'm having this strange problem while uploading file in flex using
 FileReference, that even though I set the the request attribute on the
 flex side, and I verified that before I call fileRef.upload, the
 URLRequest object has all the attributes I set in its data property.
 But when the request arrived on the java servlet side, the
 httprequest contains no attributes at all. Below is the code snippet
 that I'm using to perform the upload, this processUpload method is
 called after the user has browsed for a file, then hit upload so I'm
 only registering the COMPLETE event here. fileRef is a global
 variable of type FileReference in the enclosing file.
 private function processUpload(func:Function):void

 {

 fileRef.addEventListener(Event.COMPLETE, func);

 var request:URLRequest = new
 URLRequest(FileImportConfigurationSource.HOST_PORT_CONTEXT +
 /FileUploadServlet);

 var params:URLVariables = new URLVariables();

 //Read file header data from UI input

 var client:FIClient = clientList.selectedItem as FIClient;

 var mnemonic:String = mnemonicList.selectedLabel;

 uploadFileId = UIDUtil.createUID().toString();

 params.uploadFileId = uploadFileId;

 params.transmissionId = testing;

 request.data = params;

 fileRef.upload(request);

 }

 Anyone spot any wrongdoing in the above code? Thanks.

 Ban

  




-- 
-abdul
---
http://abdulqabiz.com/blog/
---


Re: [flexcoders] crossdomain.xml... real or not-so-real security?

2007-10-28 Thread Abdul Qabiz
 If that same evil person can get to your hosts file, that's the fault of
the OS and not Flash.

Yup! Machine is already compromised and that guy can do lots of other things
:)

-abdul

On 10/27/07, Alex Harui [EMAIL PROTECTED] wrote:

That's right.  The goal of crossdomain.xml is to limit what an evil
 person can do in a SWF served over the web so that the unsuspecting Web
 citizen isn't burned.  It does not block access to the contents from someone
 who has the desire to see the content on their machine.  If that same evil
 person can get to your hosts file, that's the fault of the OS and not Flash.


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Abdul Qabiz
 *Sent:* Friday, October 26, 2007 1:40 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] crossdomain.xml... real or not-so-real
 security?



 Isn't it like running a standalone SWF which can access network and local
 data (provided u have right trust config)? Why to run a internal server and
 create host entry? SWF in AIR/Standalone can access data from foo.com.

 Can you put (give an example) this use-case in context of internet
 (public)?

 -abdul

 On 10/26/07, *geoffreymina*  [EMAIL PROTECTED] wrote:

 Say there is a site which has a crossdomain.xml defined:

 http://www.foo.com/crossdomain.xml

 with

 allow-access-from domain=*.foo.com/

 If I were to load an SWF file on my internal webserver and create a
 local host file which contained an entry for fake.foo.com could I then
 load the SWF file from fake.foo.com and access data on www.foo.com?

 If this is the case, then it seems to me that crossdomain.xml is really
 just something to make people feel warm and fuzzy... and not at all a
 real security measure.

 Thanks,
 Geoff




 --
 -abdul
 ---
 http://abdulqabiz.com/blog/
 ---

  




-- 
-abdul
---
http://abdulqabiz.com/blog/
---


Re: [flexcoders] Re: removechild and addchild cause flickering , help~

2007-10-28 Thread Abdul Qabiz
Yup! To avoid that you can load the image in other loader and swap it once
it's loaded...Something like double-buffering..

-abdul

On 10/29/07, Alex Harui [EMAIL PROTECTED] wrote:

Image loading is asynchronous and could take any number of frames on a
 slow network.


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *icykorpio
 *Sent:* Sunday, October 28, 2007 8:03 AM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Re: removechild and addchild cause flickering ,
 help~



 i find only the first time i do the switch, the flicker appear.

 seems any UIComponent the first time be drawn needs two frames to show
 up.

  




-- 
-abdul
---
http://abdulqabiz.com/blog/
---


Re: [flexcoders] JS - How to send a byteArray using HTTPService??

2007-10-28 Thread Abdul Qabiz
Note sure, if HTTPService allows anything beyond text You can use
URLLoader to send the data to server..

-abdul

On 10/25/07, Jeff Schuenke [EMAIL PROTECTED] wrote:

   Hello All,

 I need to do a screen capture of a UIComponenet and allow the user to save
 this to their local drive.  I understand thsi will need to go throu the
 server.  I have read about the ImageSnapshot and PNGEncode methods in SDK 3
 so I can get the BitmapData ( this example is using SDK 2).  What I don't
 see how to do is send this to the server.  I am trying this:

 //get the data
 var exportImage:BitmapData =  new BitmapData(100,100);
 exportImage.draw(UIComponenet_name);

 var outData:ByteArray = new ByteArray();
 outData.readBytes(exportImage.getPixels(new Rectangle(0,0,100,100)));

 var sendImage:HTTPService = new HTTPService();
 sendImage.method = POST;
 sendImage.url = http://www.host.com/serverSave.php;;
 sendImage.send({HTTP_RAW_POST_DATA:outData.writeBytes(outData), name:'
 image.png'});


  This is not working and it is only a guess.  How can I send the data or
 is it possibile to do this as a POST??

 Thanks,



 Jeff

  




-- 
-abdul
---
http://abdulqabiz.com/blog/
---