Re: [flexcoders] Re: Print existing documents in Flex

2009-04-05 Thread Paul Andrews

- Original Message - 
From: Amy amyblankens...@bellsouth.net
To: flexcoders@yahoogroups.com
Sent: Sunday, April 05, 2009 6:03 AM
Subject: [flexcoders] Re: Print existing documents in Flex


 --- In flexcoders@yahoogroups.com, Paul Andrews p...@... wrote:

snip

 Interesting suggestion - might be a problem with pagination - you'd want
 each document to at least start on a new page. AFAIK it's not possible to
 force a page break in a HTML document.

 http://www.w3schools.com/HTMLDOM/prop_style_pagebreakafter.asp
 http://www.w3schools.com/CSS/pr_print_pageba.asp
 http://www.w3schools.com/Css/pr_print_pagebb.asp

 If you didn't strip out the body tags and that actually didn't break 
 anything, you could use page-break-after on body tags.

That's really interesting Amy, I hadn't known about that. Thanks for looking 
up the references.

Paul

 HTH;

 Amy



Re: [flexcoders] Flex, SharePoint and SQLServer

2009-04-05 Thread Paul Andrews
- Original Message - 
  From: Tracy Spratt 
  To: flexcoders@yahoogroups.com 
  Sent: Sunday, April 05, 2009 5:01 AM
  Subject: RE: [flexcoders] Flex, SharePoint and SQLServer


  snip

  Flex can't really talk directly to a database.  Supposedly, the later SQL 
Server versions support native http access.  If that really works, scalably and 
securely, then you could use HTTPService in Flex to communicate with the db.  I 
have not tried this, nor have I heard any success stories about that approach.



You'd really have to handle that with care on anything but (perhaps) an 
intranet - a swf decompiler could expose your DB innards and security..

  snip

  Tracy Spratt,

  Lariat Services, development services available


--

  From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On 
Behalf Of Mic
  Sent: Saturday, April 04, 2009 11:39 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Flex, SharePoint and SQLServer

   

  Just got introduced to the wonderful world of SharePoint recently, and am 
contemplating coding the client's BI application in Flex and then embedding 
into SharePoint. Are people doing this? All the data must come from 
SQLServer2005. Done some googling and understand that I could

  1. Load data into SharePoint lists and then send to Flex
  2. Talk to 2005 directly from Flex.

  Is this correct and which is the better approach?

  Are there any examples of this kind of architecture? I did not really find 
much after a couple of hours of googling. 

  I have looked at ASP.NET and VisualStudio etc and just feel I could do a 
better job with Flex. Don't want to infer Flex is superior, but I do know that 
I can write the app they need in Flex. Is this a sensible approach? Thanks in 
advance for any pointers,

  Mic.




  

[flexcoders] undefined SampleDataEvent

2009-04-05 Thread Florian Heft
Hello everybody,

I'm playing around with the new sound capabilities of Flash10 and wanted 
to try out an example I found on the internet.
Basically, I ported the DynamicSoundSample1 from 
http://www.adobe.com/devnet/flash/articles/dynamic_sound_generation/ to 
Flex 3.

But I keep getting the error Flex error: type was not found or was not 
a compile-time constant: SampleDataEvent.

Indeed, Flex Builder also doesn't show SampleDataEvent in the code 
completition of import flash.events..

According to the LiveDocs, SampleDataEvents should be available in
Flex 3.3 (and I recently updated the SDK to 3.3 and updated the project 
options):
http://livedocs.adobe.com/flex/3/langref/flash/events/SampleDataEvent.html

What am I doing wrong?

Simplest reproducable code:
---
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute
mx:Script
![CDATA[
import flash.events.SampleDataEvent;
function sampleDataHandler(event:SampleDataEvent):void
{
}
]]
/mx:Script
/mx:Application
---


Best regards,
florian heft





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location: 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:flexcoders-dig...@yahoogroups.com 
mailto:flexcoders-fullfeatu...@yahoogroups.com

* To unsubscribe from this group, send an email to:
flexcoders-unsubscr...@yahoogroups.com

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



[flexcoders] Loading AS2 SWF in Flex 3

2009-04-05 Thread Hyder
I'm trying to load an AS2 swf using SWFLoader (Embedded) in a TitleWindow.

The SWF file plays fine in a standalone player, but when embedded in Flex, AS2 
scripted animations don't display.

I'm loading it inside Flex so that I can communicate using LocalConnection. 
Right now, I'm loading it in a separate HTML file but there's no way of 
communication with Flex.


So, I need to know either how I can embed the SWF file in Flex without losing 
any of its AS2 script, or how I can communicate between Flex and Flash when 
they're loading in two different wrappers.

I need to send product objects from AS2 Flash to Flex, so it's not just polling 
which could've been achieved by manipulating the URL.



Re: [flexcoders] Loading AS2 SWF in Flex 3

2009-04-05 Thread Paul Andrews

- Original Message - 
From: Hyder hyder_...@hotmail.com
To: flexcoders@yahoogroups.com
Sent: Sunday, April 05, 2009 5:47 PM
Subject: [flexcoders] Loading AS2 SWF in Flex 3


 I'm trying to load an AS2 swf using SWFLoader (Embedded) in a TitleWindow.

 The SWF file plays fine in a standalone player, but when embedded in Flex, 
 AS2 scripted animations don't display.

 I'm loading it inside Flex so that I can communicate using 
 LocalConnection. Right now, I'm loading it in a separate HTML file but 
 there's no way of communication with Flex.


 So, I need to know either how I can embed the SWF file in Flex without 
 losing any of its AS2 script, or how I can communicate between Flex and 
 Flash when they're loading in two different wrappers.

 I need to send product objects from AS2 Flash to Flex, so it's not just 
 polling which could've been achieved by manipulating the URL.

Check out LocalConnection. Going the opposite way is described here: 
http://www.learningactionscript3.com/2007/12/14/sending-data-from-avm2-to-avm1/#more-29

Paul 



[flexcoders] Re: Flex to Air comminication via LocalConnection - Error #2044

2009-04-05 Thread ericbichara
Wow that worked like a charm, thanks mate

/Eric



[flexcoders] Re: Flex, SharePoint and SQLServer

2009-04-05 Thread Tim Hoff

Yes, you can get xml data from a SQL-Server database directly through
xPath url queries.  The risk here though is that it opens up the
possibility of SQL injection and isn't that secure.  Your options are to
create your own .Net web services or look into using a middle tier
solution like WebOrb; for connectivity between a Flex client and a .Net
backend.

-TH

--- In flexcoders@yahoogroups.com, Paul Andrews p...@... wrote:

 - Original Message -
 From: Tracy Spratt
 To: flexcoders@yahoogroups.com
 Sent: Sunday, April 05, 2009 5:01 AM
 Subject: RE: [flexcoders] Flex, SharePoint and SQLServer


 snip

 Flex can't really talk directly to a database. Supposedly, the later
SQL Server versions support native http access. If that really works,
scalably and securely, then you could use HTTPService in Flex to
communicate with the db. I have not tried this, nor have I heard any
success stories about that approach.



 You'd really have to handle that with care on anything but (perhaps)
an intranet - a swf decompiler could expose your DB innards and
security..

 snip

 Tracy Spratt,

 Lariat Services, development services available



\
--

 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com]
On Behalf Of Mic
 Sent: Saturday, April 04, 2009 11:39 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Flex, SharePoint and SQLServer



 Just got introduced to the wonderful world of SharePoint recently, and
am contemplating coding the client's BI application in Flex and then
embedding into SharePoint. Are people doing this? All the data must come
from SQLServer2005. Done some googling and understand that I could

 1. Load data into SharePoint lists and then send to Flex
 2. Talk to 2005 directly from Flex.

 Is this correct and which is the better approach?

 Are there any examples of this kind of architecture? I did not really
find much after a couple of hours of googling.

 I have looked at ASP.NET and VisualStudio etc and just feel I could do
a better job with Flex. Don't want to infer Flex is superior, but I do
know that I can write the app they need in Flex. Is this a sensible
approach? Thanks in advance for any pointers,

 Mic.






[flexcoders] Re: How to create your own IFlexModuleFactory?

2009-04-05 Thread skuteboarding
Yes, I think IFlexModuleFactory possibly isn't what I'm after. I was basically 
looking for ways to initialise custom modules (plugins) in a correct order with 
specific values. I've since abandoned that idea and had my main plugin object 
initialised in the constructor of each module. 

Thanks,

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

 Check out Module.as.  There should be [Frame] metadata that specifies the 
 class that implements IFlexModuleFactory that will be used as the root of the 
 module SWF.  AFAIK, nobody has ever gone down this road before.  There's a 
 90% chance that there's some other way to do what you want without going down 
 this road.
 
 Describe your goals with a bit more detail and we'll see if there's some 
 easier way.
 
 Alex Harui
 Flex SDK Developer
 Adobe Systems Inc.http://www.adobe.com/
 Blog: http://blogs.adobe.com/aharui
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On 
 Behalf Of skuteboarding
 Sent: Saturday, April 04, 2009 12:45 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] How to create your own IFlexModuleFactory?
 
 
 Hi,I'm interested in implementing the IFlexModuleFactory interface in my 
 modules - mainly so I can manually control the creation of my objects.
 
 What do I need to implement this in my module?





[flexcoders] Flex Component Kit still needed for CS4?

2009-04-05 Thread brad.bueche
I know CS3 needed the flex component kit.  Does CS4 need it as well?

Its confusing because this page:

http://help.adobe.com/en_US/Flash/10.0_UsingFlash/WSFD77A256-0DE1-46c7-86FB-CC4A8AE2EAA6.html

which is for CS4, sends you to the component page, but the component page only 
mentions CS3.

brad



[flexcoders] var circle:Sprite = new Sprite(); Not working

2009-04-05 Thread brad.bueche
I'm at a loss here.  I copied this code straight off the adobe site:
 
http://livedocs.adobe.com/flex/3/html/help.html?content=05_Display_Programming_29.html
 
And copied it write into a new mxml project (below) and Flex is throwing 1120 
erorrs saying circle is undefined.  How can that be?
 
**
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute
 mx:Script
  ![CDATA[
   import flash.display.Sprite;
   import flash.events.Event;
   import flash.events.MouseEvent;

   var circle:Sprite = new Sprite();
   circle.graphics.beginFill(0x99);
   circle.graphics.drawCircle(50, 50, 50);
   circle.graphics.endFill();
   addChild(circle);

   function fadeCircle(event:Event):void{
  circle.alpha -= .05;

if (circle.alpha = 0){
   circle.removeEventListener(Event.ENTER_FRAME, fadeCircle);
}
}

function startAnimation(event:MouseEvent):void{
circle.addEventListener(Event.ENTER_FRAME, fadeCircle);
}

circle.addEventListener(MouseEvent.CLICK, startAnimation);
 
 ]]
 /mx:Script

/mx:Application



[flexcoders] Bizarre browser inconsistencies...?

2009-04-05 Thread one_rabbit_one
Hi,
I had thought that I had successfully finished my first Flex application - my 
portfolio constructed from four modules... at showreel.inkthing.net/Patch.html 
- but have discovered that in Firefox the Radio module throws a security error 
despite the mp3player and the crossdomain.xml both specifying and allowing 
access to that subdomain.  And then weird! It works in Safari - and it works in 
Firefox (sometimes) if the subdomain is loaded as 
www.inkthing.net/showreel/Patch.html. Can anyone throw any light on this 
strange, frustrating behaviour?



Re: [flexcoders] Re: New Adobe forums coming!

2009-04-05 Thread Matt Chotin
I know there are plenty of people who still use NNTP (I certainly hadn't 
realized how popular it remained among our community since it didn't seem to 
work so well for me).  But yes, we won't be able to support NNTP right now.  
That said, most email clients today support threading of messages which means 
that you can have pretty much the same experience as what you were getting 
before.  To me, not having to launch another client to track the forums is a 
pretty significant win (since my email client doesn't support NNTP).

I realize I won't be able to convince the diehards of the benefits of the 
overall change, but I'm willing to go out on a limb and say that this change is 
going to benefit the majority of the Flex community.

Matt


On 4/4/09 11:52 AM, Amy amyblankens...@bellsouth.net wrote:




--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , 
Nancy Gill na...@... wrote:

 What will happen to the NNTP access?

 It will be gone.   :(
 This is a huge mistake on Adobe's part.

Well, I guess I'll be using the forums exactly once...to explain to the people 
who have gotten help from me in the past why they are not going to be able to 
get it from me in the future.

Kind of a shame, but possibly the power users that are happier doing things by 
e.mail will be able to replace the ones that have traditionally used nntp.

-Amy







[flexcoders] Trying to dynamically populate checkboxes via array binding

2009-04-05 Thread Benoit Villière
Hello everyone,

I am making a first AIR application which is a simple task manager. It's
been built with AS, and uses SQLite to handle data. I would like to display
the tasks in a simple list of checkboxes, but my MXML knowledge is very low
and I ended up with this :

mx:List dataProvider={taskCollection}
mx:CheckBox
label={data.task}
selected={data.id}/
/mx:List

I would love being able to do it this way and get it working properly :

mx:CheckBox
   dataProvider={taskCollection}
   label={data.task} selected={data.id}/

I feel like I don't get the MXML way to do things... That's why I ask you
Gurus some precious help :)

Regards,
Benoit V.


RE: [flexcoders] var circle:Sprite = new Sprite(); Not working

2009-04-05 Thread Tracy Spratt
That error is often caused by attempting to initialize a complex variable
outside of a function.  This is because of the way mxml files are generated
into classes.

 

Declare the circle variable in instance scope as you have, but do the
initialization in a function called by creationComplete.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of brad.bueche
Sent: Sunday, April 05, 2009 4:39 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] var circle:Sprite = new Sprite(); Not working

 

I'm at a loss here. I copied this code straight off the adobe site:

http://livedocs.
http://livedocs.adobe.com/flex/3/html/help.html?content=05_Display_Programm
ing_29.html
adobe.com/flex/3/html/help.html?content=05_Display_Programming_29.html

And copied it write into a new mxml project (below) and Flex is throwing
1120 erorrs saying circle is undefined. How can that be?

**
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml
com/2006/mxml layout=absolute
mx:Script
![CDATA[
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;

var circle:Sprite = new Sprite();
circle.graphics.beginFill(0x99);
circle.graphics.drawCircle(50, 50, 50);
circle.graphics.endFill();
addChild(circle);

function fadeCircle(event:Event):void{
circle.alpha -= .05;

if (circle.alpha = 0){
circle.removeEventListener(Event.ENTER_FRAME, fadeCircle);
}
}

function startAnimation(event:MouseEvent):void{
circle.addEventListener(Event.ENTER_FRAME, fadeCircle);
}

circle.addEventListener(MouseEvent.CLICK, startAnimation);

]]
/mx:Script

/mx:Application





Re: [flexcoders] var circle:Sprite = new Sprite(); Not working

2009-04-05 Thread Nate Beck
Tracy beat me to it... but I'm going to send my email as well :).
This is because your code isn't in an event handler.  In MXML you can't have
free-floating script, just like in an ActionScript 3 class, you can't have
circle.graphics.beginFill(0x99) outside of a method.
I recommend doing the following:

Change your mx:Application tag to read as this:
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute
creationComplete=onReady()

Then:

mx:Script
![CDATA[
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;

private function onReady():void {
var circle:Sprite = new Sprite();
circle.graphics.beginFill(0x99);
circle.graphics.drawCircle(50, 50, 50);
circle.graphics.endFill();
addChild(circle);
}

]]
/mx:Script



On Sun, Apr 5, 2009 at 1:38 PM, brad.bueche b...@bueche.com wrote:

   I'm at a loss here. I copied this code straight off the adobe site:


 http://livedocs.adobe.com/flex/3/html/help.html?content=05_Display_Programming_29.html

 And copied it write into a new mxml project (below) and Flex is throwing
 1120 erorrs saying circle is undefined. How can that be?

 **
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute
 mx:Script
 ![CDATA[
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.MouseEvent;

 var circle:Sprite = new Sprite();
 circle.graphics.beginFill(0x99);
 circle.graphics.drawCircle(50, 50, 50);
 circle.graphics.endFill();
 addChild(circle);

 function fadeCircle(event:Event):void{
 circle.alpha -= .05;

 if (circle.alpha = 0){
 circle.removeEventListener(Event.ENTER_FRAME, fadeCircle);
 }
 }

 function startAnimation(event:MouseEvent):void{
 circle.addEventListener(Event.ENTER_FRAME, fadeCircle);
 }

 circle.addEventListener(MouseEvent.CLICK, startAnimation);

 ]]
 /mx:Script

 /mx:Application

  




-- 

Cheers,
Nate

http://blog.natebeck.net


[flexcoders] Eclipse Ganymede

2009-04-05 Thread Albert Waltner
Still using Windows XP and trying Eclipse Ganymede with Flex 3.
The messages going back to 9/08 discuss Ganymede problems but without 
a clear explanation. I have installed Eclipse 3.2.2 and Flex3 and 
that works but when installing Eclipse current version (Ganymede) 
it does not.
On Adobe.com an example posted says it uses Eclipse Ganymede so,
it would seem, the poster had NO problems with Ganymede. Why not?
Everyone OK with Ganymede? Or not using it? Thanks. 



Re: [flexcoders] Eclipse Ganymede

2009-04-05 Thread Toby Tremayne
I have installed ganymede with the flex builder 3 plugin, mylin,  
subclipse, cfeclipse, mxunit etc and it's working beautifully.


Toby

On 06/04/2009, at 10:29 AM, Albert Waltner wrote:


Still using Windows XP and trying Eclipse Ganymede with Flex 3.
The messages going back to 9/08 discuss Ganymede problems but without
a clear explanation. I have installed Eclipse 3.2.2 and Flex3 and
that works but when installing Eclipse current version (Ganymede)
it does not.
On Adobe.com an example posted says it uses Eclipse Ganymede so,
it would seem, the poster had NO problems with Ganymede. Why not?
Everyone OK with Ganymede? Or not using it? Thanks.







Toby Tremayne
CEO
Magic Industries
http://www.magicindustries.net
mob: 0416 048 090
icq: 13107913
skype: lyricist1






RE: [flexcoders] Eclipse Ganymede

2009-04-05 Thread Tim Rowe
I recently installed Builder on a fresh system with Eclipse(Ganymede), and had 
to do two things:
1.  Install the old Builder Plug-in to my Ganymede install.  You have to insist 
yes, this is an eclipse dir
2.  Get the absolute latest version of builder standalone, and then copy over 
the newer jars from that install to my plug-in environment.

Supposedly the plug-in version is available as the same version, but I couldn't 
find it.

Alternatively, try this:
http://www.tekool.net/blog/2008/06/28/flex-builder-3-plugin-dont-work-with-eclipse-34/

Tim Rowe
Software Engineer
carsales.com Ltd


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Albert Waltner
Sent: Monday, 6 April 2009 10:30 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Eclipse Ganymede


Still using Windows XP and trying Eclipse Ganymede with Flex 3.
The messages going back to 9/08 discuss Ganymede problems but without
a clear explanation. I have installed Eclipse 3.2.2 and Flex3 and
that works but when installing Eclipse current version (Ganymede)
it does not.
On Adobe.com an example posted says it uses Eclipse Ganymede so,
it would seem, the poster had NO problems with Ganymede. Why not?
Everyone OK with Ganymede? Or not using it? Thanks.





[flexcoders] Re: Trying to dynamically populate checkboxes via array binding

2009-04-05 Thread Tim Hoff

Hi Benoit,

You're going to want to use an itemRenderer for the checkBox's.  Tracey
Spratt has an example here:

http://www.cflex.net/showFileDetails.cfm?ObjectID=559
http://www.cflex.net/showFileDetails.cfm?ObjectID=559

-TH

--- In flexcoders@yahoogroups.com, Benoit Villière benv...@...
wrote:

 Hello everyone,

 I am making a first AIR application which is a simple task manager.
It's
 been built with AS, and uses SQLite to handle data. I would like to
display
 the tasks in a simple list of checkboxes, but my MXML knowledge is
very low
 and I ended up with this :

 mx:List dataProvider={taskCollection}
 mx:CheckBox
 label={data.task}
 selected={data.id}/
 /mx:List

 I would love being able to do it this way and get it working properly
:

 mx:CheckBox
 dataProvider={taskCollection}
 label={data.task} selected={data.id}/

 I feel like I don't get the MXML way to do things... That's why I ask
you
 Gurus some precious help :)

 Regards,
 Benoit V.





[flexcoders] Re: var circle:Sprite = new Sprite(); Not working

2009-04-05 Thread brad.bueche
Thanks Tracy, Nate!

Ok, that worked, in that it got rid of the errors.  But then I got a type 
conversion error about not being able to convert a Sprite to a UIComponent.  So 
I read throught some blogs and found this rawchildren solution and using Shape 
too.  So now I get a circle on the screen with no errors but the evenhandlers 
dont seem to be working.

Here is what I have (below).  I think I'm going to have to use a timer.  I dont 
think that .ENTERRAME is going to work in Flex is it?

Here is a nice example.  I might take this route instead.

http://www.fortegames.com/games/CannonBall/CannonBallTest.html

brad
code follows
***
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute creationComplete=buildCircle()
mx:Script
 ![CDATA[
  import flash.display.*;
  import flash.events.Event;
  import flash.events.MouseEvent;

  public var circle:Shape = new Shape();

  private function buildCircle():void{
 circle.graphics.beginFill(0x99);
 circle.graphics.drawCircle(50, 50, 50);
 circle.graphics.endFill();
 circle.addEventListener(MouseEvent.CLICK, startAnimation);
 this.rawChildren.addChild(circle);
  }

  private function fadeCircle(event:Event):void{
 circle.alpha -= .05;

   if (circle.alpha = 0)
   {
circle.removeEventListener(Event.ENTER_FRAME, fadeCircle);
   }
   }

   private function startAnimation(event:MouseEvent):void{
 circle.addEventListener(Event.ENTER_FRAME, fadeCircle);
   }
  
/mx:Script

/mx:Application

--- In flexcoders@yahoogroups.com, Nate Beck n...@... wrote:

 Tracy beat me to it... but I'm going to send my email as well :).
 This is because your code isn't in an event handler.  In MXML you can't have
 free-floating script, just like in an ActionScript 3 class, you can't have
 circle.graphics.beginFill(0x99) outside of a method.
 I recommend doing the following:
 
 Change your mx:Application tag to read as this:
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute
 creationComplete=onReady()
 
 Then:
 
 mx:Script
 ![CDATA[
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.MouseEvent;
 
 private function onReady():void {
 var circle:Sprite = new Sprite();
 circle.graphics.beginFill(0x99);
 circle.graphics.drawCircle(50, 50, 50);
 circle.graphics.endFill();
 addChild(circle);
 }
 
 ]]
 /mx:Script
 
 
 
 On Sun, Apr 5, 2009 at 1:38 PM, brad.bueche b...@... wrote:
 
I'm at a loss here. I copied this code straight off the adobe site:
 
 
  http://livedocs.adobe.com/flex/3/html/help.html?content=05_Display_Programming_29.html
 
  And copied it write into a new mxml project (below) and Flex is throwing
  1120 erorrs saying circle is undefined. How can that be?
 
  **
  ?xml version=1.0 encoding=utf-8?
  mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
  layout=absolute
  mx:Script
  ![CDATA[
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.events.MouseEvent;
 
  var circle:Sprite = new Sprite();
  circle.graphics.beginFill(0x99);
  circle.graphics.drawCircle(50, 50, 50);
  circle.graphics.endFill();
  addChild(circle);
 
  function fadeCircle(event:Event):void{
  circle.alpha -= .05;
 
  if (circle.alpha = 0){
  circle.removeEventListener(Event.ENTER_FRAME, fadeCircle);
  }
  }
 
  function startAnimation(event:MouseEvent):void{
  circle.addEventListener(Event.ENTER_FRAME, fadeCircle);
  }
 
  circle.addEventListener(MouseEvent.CLICK, startAnimation);
 
  ]]
  /mx:Script
 
  /mx:Application
 
   
 
 
 
 
 -- 
 
 Cheers,
 Nate
 
 http://blog.natebeck.net





RE: [flexcoders] Re: var circle:Sprite = new Sprite(); Not working

2009-04-05 Thread Tracy Spratt
You do NOT want to use rawChildren, stick with normal practices..

 

Sprite is too low level to add to a Flex container.  You need to wrap it in
a UIComponent.  I don't have a real example, but it will be something like:

var uic:UIComponent = new UIComponent();

uic.addChild(circle);

this.addChild(uic)

 

ENTERFRAME might work, it depends on what you want to happen.  Flex handles
frames differently that Flash might.  What are you trying to do?

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of brad.bueche
Sent: Sunday, April 05, 2009 9:42 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: var circle:Sprite = new Sprite(); Not working

 

Thanks Tracy, Nate!

Ok, that worked, in that it got rid of the errors. But then I got a type
conversion error about not being able to convert a Sprite to a UIComponent.
So I read throught some blogs and found this rawchildren solution and using
Shape too. So now I get a circle on the screen with no errors but the
evenhandlers dont seem to be working.

Here is what I have (below). I think I'm going to have to use a timer. I
dont think that .ENTERRAME is going to work in Flex is it?

Here is a nice example. I might take this route instead.

http://www.fortegam
http://www.fortegames.com/games/CannonBall/CannonBallTest.html
es.com/games/CannonBall/CannonBallTest.html

brad
code follows
***
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml
com/2006/mxml
layout=absolute creationComplete=buildCircle()
mx:Script
![CDATA[
import flash.display.*;
import flash.events.Event;
import flash.events.MouseEvent;

public var circle:Shape = new Shape();

private function buildCircle():void{
circle.graphics.beginFill(0x99);
circle.graphics.drawCircle(50, 50, 50);
circle.graphics.endFill();
circle.addEventListener(MouseEvent.CLICK, startAnimation);
this.rawChildren.addChild(circle);
}

private function fadeCircle(event:Event):void{
circle.alpha -= .05;

if (circle.alpha = 0)
{
circle.removeEventListener(Event.ENTER_FRAME, fadeCircle);
}
}

private function startAnimation(event:MouseEvent):void{
circle.addEventListener(Event.ENTER_FRAME, fadeCircle);
}

/mx:Script

/mx:Application

--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
Nate Beck n...@... wrote:

 Tracy beat me to it... but I'm going to send my email as well :).
 This is because your code isn't in an event handler. In MXML you can't
have
 free-floating script, just like in an ActionScript 3 class, you can't
have
 circle.graphics.beginFill(0x99) outside of a method.
 I recommend doing the following:
 
 Change your mx:Application tag to read as this:
 mx:Application xmlns:mx=http://www.adobe.
http://www.adobe.com/2006/mxml com/2006/mxml layout=absolute
 creationComplete=onReady()
 
 Then:
 
 mx:Script
 ![CDATA[
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.MouseEvent;
 
 private function onReady():void {
 var circle:Sprite = new Sprite();
 circle.graphics.beginFill(0x99);
 circle.graphics.drawCircle(50, 50, 50);
 circle.graphics.endFill();
 addChild(circle);
 }
 
 ]]
 /mx:Script
 
 
 
 On Sun, Apr 5, 2009 at 1:38 PM, brad.bueche b...@... wrote:
 
  I'm at a loss here. I copied this code straight off the adobe site:
 
 
  http://livedocs.
http://livedocs.adobe.com/flex/3/html/help.html?content=05_Display_Programm
ing_29.html
adobe.com/flex/3/html/help.html?content=05_Display_Programming_29.html
 
  And copied it write into a new mxml project (below) and Flex is throwing
  1120 erorrs saying circle is undefined. How can that be?
 
  **
  ?xml version=1.0 encoding=utf-8?
  mx:Application xmlns:mx=http://www.adobe.
http://www.adobe.com/2006/mxml com/2006/mxml
  layout=absolute
  mx:Script
  ![CDATA[
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.events.MouseEvent;
 
  var circle:Sprite = new Sprite();
  circle.graphics.beginFill(0x99);
  circle.graphics.drawCircle(50, 50, 50);
  circle.graphics.endFill();
  addChild(circle);
 
  function fadeCircle(event:Event):void{
  circle.alpha -= .05;
 
  if (circle.alpha = 0){
  circle.removeEventListener(Event.ENTER_FRAME, fadeCircle);
  }
  }
 
  function startAnimation(event:MouseEvent):void{
  circle.addEventListener(Event.ENTER_FRAME, fadeCircle);
  }
 
  circle.addEventListener(MouseEvent.CLICK, startAnimation);
 
  ]]
  /mx:Script
 
  /mx:Application
 
  
 
 
 
 
 -- 
 
 Cheers,
 Nate
 
 http://blog. http://blog.natebeck.net natebeck.net






[flexcoders] Sharing objects (BitmapData) between 2 loaded swfs

2009-04-05 Thread p0lish_sausage
Hello everyone,

I'm wondering if Flex has the capability of having 2 loaded swfs on a webpage 
that share the same complex objects, in memory. What I want to do load a 
bitmapdata in A.swf, and then reference  use it both in A.swf and B.swf at the 
same time. I'd like when the bitmap in A.swf gets updated the B.swf is updated 
automatically, because it's pointing to the same object.

I've found documentation for SharedObjects, however the amount of data I'll be 
storing is in the megabytes and speed is at the utmost importance, so it 
shouldn't be hitting the users local disk, so that won't work.

Any suggestions for the above mentioned would be much appreciated.

Mark





RE: [flexcoders] Sharing objects (BitmapData) between 2 loaded swfs

2009-04-05 Thread Tracy Spratt
Local connection is probably a better option.

 

Do you have a compelling use-case for having two swfs?  That complicates
issues considerably.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of p0lish_sausage
Sent: Sunday, April 05, 2009 9:18 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Sharing objects (BitmapData) between 2 loaded swfs

 

Hello everyone,

I'm wondering if Flex has the capability of having 2 loaded swfs on a
webpage that share the same complex objects, in memory. What I want to do
load a bitmapdata in A.swf, and then reference  use it both in A.swf and
B.swf at the same time. I'd like when the bitmap in A.swf gets updated the
B.swf is updated automatically, because it's pointing to the same object.

I've found documentation for SharedObjects, however the amount of data I'll
be storing is in the megabytes and speed is at the utmost importance, so it
shouldn't be hitting the users local disk, so that won't work.

Any suggestions for the above mentioned would be much appreciated.

Mark





[flexcoders] Re: Flex Component Kit still needed for CS4?

2009-04-05 Thread Amy
--- In flexcoders@yahoogroups.com, brad.bueche b...@... wrote:

 I know CS3 needed the flex component kit.  Does CS4 need it as well?
 
 Its confusing because this page:
 
 http://help.adobe.com/en_US/Flash/10.0_UsingFlash/WSFD77A256-0DE1-46c7-86FB-CC4A8AE2EAA6.html
 
 which is for CS4, sends you to the component page, but the component page 
 only mentions CS3.

What do you mean by needed?  The component kit is kind of a convenience for 
wrapping a flash MC or Sprite so it looks just like a component to Flex, but 
you've always had the option of loading an ordinary swf into a swfloader.



RE: [flexcoders] Loading AS2 SWF in Flex 3

2009-04-05 Thread Alex Harui
And keep in mind that if you use @Embed or [Embed], any AS2 in the SWF may be 
stripped out.

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

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Paul Andrews
Sent: Sunday, April 05, 2009 10:00 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Loading AS2 SWF in Flex 3


- Original Message -
From: Hyder hyder_...@hotmail.commailto:Hyder_m29%40hotmail.com
To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
Sent: Sunday, April 05, 2009 5:47 PM
Subject: [flexcoders] Loading AS2 SWF in Flex 3

 I'm trying to load an AS2 swf using SWFLoader (Embedded) in a TitleWindow.

 The SWF file plays fine in a standalone player, but when embedded in Flex,
 AS2 scripted animations don't display.

 I'm loading it inside Flex so that I can communicate using
 LocalConnection. Right now, I'm loading it in a separate HTML file but
 there's no way of communication with Flex.


 So, I need to know either how I can embed the SWF file in Flex without
 losing any of its AS2 script, or how I can communicate between Flex and
 Flash when they're loading in two different wrappers.

 I need to send product objects from AS2 Flash to Flex, so it's not just
 polling which could've been achieved by manipulating the URL.

Check out LocalConnection. Going the opposite way is described here:
http://www.learningactionscript3.com/2007/12/14/sending-data-from-avm2-to-avm1/#more-29

Paul