[Flashcoders] AS3 MOUSE_OVER/OUT bubbling

2009-07-05 Thread Andrew Sinning
I've read though the documentation regarding event bubbling several 
times, but the concept remains blurry.  Perhaps this example will help 
me get my head around it.


I want to display a custom cursor, a version of the Photoshop flat 
hand cursor, whenever the mouse is over a cropped image to indicate 
that it can be moved around within the frame.  So, I have for the sprite 
of the image,  MOUSE_OVER turns on and MOUSE_OUT turns off the custom 
cursor.  The custom cursor object simply hides or displays the Mouse and 
has a sprite on the top level of the stage with startDrag() and stopDrag().


The problem is that as soon as the custom cursor's sprite becomes 
visible, it causes a MOUSE_OUT event to get called on the image (because 
the image is intercepting the mouse-over?) and then the custom cursor 
gets turned off again.  The result is a flashing cursor.  Nice effect, 
but not what I have in mind.


Thanks in advance for any guidance!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AS3 MOUSE_OVER/OUT bubbling

2009-07-05 Thread Rob Romanek

Hey Andrew,

Try setting mouseEnabled to false for your cursor sprite.

hth,

Rob

On 5-Jul-09, at 8:40 AM, Andrew Sinning wrote:

The problem is that as soon as the custom cursor's sprite becomes  
visible, it causes a MOUSE_OUT event to get called on the image  
(because the image is intercepting the mouse-over?) and then the  
custom cursor gets turned off again.  The result is a flashing  
cursor.  Nice effect, but not what I have in mind.



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AS3 MOUSE_OVER/OUT bubbling

2009-07-05 Thread Jiri

Did u try ROLL_OVER / ROLL_OUT to?

Jiri

Andrew Sinning wrote:
I've read though the documentation regarding event bubbling several 
times, but the concept remains blurry.  Perhaps this example will help 
me get my head around it.


I want to display a custom cursor, a version of the Photoshop flat 
hand cursor, whenever the mouse is over a cropped image to indicate 
that it can be moved around within the frame.  So, I have for the sprite 
of the image,  MOUSE_OVER turns on and MOUSE_OUT turns off the custom 
cursor.  The custom cursor object simply hides or displays the Mouse and 
has a sprite on the top level of the stage with startDrag() and stopDrag().


The problem is that as soon as the custom cursor's sprite becomes 
visible, it causes a MOUSE_OUT event to get called on the image (because 
the image is intercepting the mouse-over?) and then the custom cursor 
gets turned off again.  The result is a flashing cursor.  Nice effect, 
but not what I have in mind.


Thanks in advance for any guidance!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Strange characters added to file when saving from AIR using fileStream

2009-07-05 Thread Jiri

I had similair behaviour. Save the xml as UTF-8 and it should be allright.

J

Kenneth Kawamoto wrote:
I may be wrong but that could be BOM? If you use writeUTF() and open the 
resulting file in a Unicode editor do you still see it?


Kenneth Kawamoto
http://www.materiaprima.co.uk/

Cheetham, Marcus wrote:

I'm using fileStream to save a text file. This works OK, but introduces
some strange characters at the beginning of the saved text.
I'm saving XML data. I've kept this as an XML object and also converted
it to string -- same thing always happens.
 
Any idea how I can get rid of these characters?
 
Thanks,
 
This is what I end up with (note the 'g at the beginning) :
 
'gorder

  item id=1
menuNameburger/menuName
price3.95/price
  /item
  item id=2
menuNamefries/menuName
price1.45/price
  /item
/order
 
This is the Flex 3 code:

?xml version=1.0 encoding=utf-8?
mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute activate=createXML()
mx:Script
 ![CDATA[
  import flash.events.Event;
  import flash.filesystem.*;
public function createXML():void   {
   x1 = order
  !--This is a comment. --
  ?PROC_INSTR sample ?
  item id='1'
 menuNameburger/menuName
  price3.95/price
  /item
  item id='2'
  menuNamefries/menuName
  price1.45/price
  /item
  /order
  }
public  var file:File;
 
  public  function saveToFile() :void

  {
   file = new File(/filename.xml);
   file.addEventListener(Event.SELECT, dirSelected);
   file.browseForSave('');
  }
   
  public  function dirSelected(e:Event) :void

  {
   // this object will get saved to the file
   var dat:String = new String;
   var str:String = new String;
   str = x1.toXMLString();
   dat = str;
   var fileStream:FileStream = new FileStream();
   fileStream.open(file, FileMode.WRITE);
   fileStream.writeObject(dat);
   fileStream.close();
  }
 
 ]]

/mx:Script
 
 mx:Button x=102 y=320 label=Save XML click=saveToFile()/

 mx:XML id=x1 format=e4x/
 
/mx:WindowedApplication

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AS3 MOUSE_OVER/OUT bubbling

2009-07-05 Thread Andrew Sinning

Thanks Rob.  That's just the ticket.

Rob Romanek wrote:

Hey Andrew,

Try setting mouseEnabled to false for your cursor sprite.

hth,

Rob

On 5-Jul-09, at 8:40 AM, Andrew Sinning wrote:

The problem is that as soon as the custom cursor's sprite becomes 
visible, it causes a MOUSE_OUT event to get called on the image 
(because the image is intercepting the mouse-over?) and then the 
custom cursor gets turned off again.  The result is a flashing 
cursor.  Nice effect, but not what I have in mind.



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Exporting Canvas to PDF or Print

2009-07-05 Thread K-Dawg
Hi,

I developed a dynamic coupon engine for a client that loads coupon data from
an XML file and draws coupons on the canvas.  This all went surprisingly
well as I am relatively new to ActionScript.  However, I need to be able to
make these printable, either printing the canvas or sending to a PDF.  How
can I do this?

I am figuring I could

1.) add a button to the page (webpage, not AS) that launches the same AS in
a separate window and calls the browser's print function.
2.) export the canvas directly to the printer (how)
3.) export the canvas to a PDF (how)

Any thoughts/suggestions are greatly appreciated.

Thanks!

Kevin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Exporting Canvas to PDF or Print

2009-07-05 Thread Ktu
You could easily have a button that calls the printer and have it print. If
you look at the documentation for AS3 there is a class called PrintJob.

You could alternativley use a third party package called AlivePDF which you
can use to make a PDF out of your flash content, and have the user download
the genereated PDF. Their site is here: http://alivepdf.bytearray.org/

Ktu

On Sun, Jul 5, 2009 at 7:29 PM, K-Dawg kdaw...@gmail.com wrote:

 Hi,

 I developed a dynamic coupon engine for a client that loads coupon data
 from
 an XML file and draws coupons on the canvas.  This all went surprisingly
 well as I am relatively new to ActionScript.  However, I need to be able to
 make these printable, either printing the canvas or sending to a PDF.  How
 can I do this?

 I am figuring I could

 1.) add a button to the page (webpage, not AS) that launches the same AS in
 a separate window and calls the browser's print function.
 2.) export the canvas directly to the printer (how)
 3.) export the canvas to a PDF (how)

 Any thoughts/suggestions are greatly appreciated.

 Thanks!

 Kevin
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AS3 MOUSE_OVER/OUT bubbling

2009-07-05 Thread Tony Fouts
Andrew,

You might also want to check out this link:

http://www.zedia.net/2008/difference-between-mouseeventroll_over-and-mouseeventmouse_over-in-as3/

It does a great job of illustrating the difference between MOUSE_OVER and
ROLL_OVER.

Tony
http://www.lifelinewebsolutions.com


On Sun, Jul 5, 2009 at 12:39 PM, Andrew Sinning and...@learningware.comwrote:

 Thanks Rob.  That's just the ticket.


 Rob Romanek wrote:

 Hey Andrew,

 Try setting mouseEnabled to false for your cursor sprite.

 hth,

 Rob

 On 5-Jul-09, at 8:40 AM, Andrew Sinning wrote:

  The problem is that as soon as the custom cursor's sprite becomes
 visible, it causes a MOUSE_OUT event to get called on the image (because the
 image is intercepting the mouse-over?) and then the custom cursor gets
 turned off again.  The result is a flashing cursor.  Nice effect, but not
 what I have in mind.

  ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders