Re: [Flashcoders] drag along custom path

2009-02-26 Thread Glen Pike

http://keith-hair.net/blog/category/actionscript-3/

Might be a good place to start...

Tom Huynen wrote:

Hi guys,

I'm trying to drag a sprite along a rectangle with rounded corners. Does
anybody know an easy way to do this?

Kind regards,

Tom
___
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] drag along custom path

2009-02-26 Thread Ivan Dembicki
Hello,

http://bezier.ru/wp-content/uploads/2008/06/bezier.swf?demo=2

Package and demo sources: http://bezier.googlecode.com/

-- 
iv
http://www.bezier.ru
http://bezier.googlecode.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] MVC(S) Question

2009-02-26 Thread Glen Pike

Hi,

   I am reworking an application we use for a touchscreen interface and 
am trying to design the architecture for all the right reasons.


   I am currently wrangled in MVC-ness and trying to work out the best 
way to move forward.  Having immersed myself in many books and texts, I 
still find myself going around in circles some of the time and would 
like to make some choices with possible help from you guys...
 
   The app talks to a back end control system via an XML socket.  The 
system has a number of devices attached and the screen controls allow 
for changing stuff on the devices and monitoring them too along with the 
application navigation, etc.


   Requirements:
   It be easy to add new screens later on.
   The coupling of component interaction to back end needs to be fairly 
fast - we use sliders and trackpads to move devices in real-ish time.
   The application may use different languages which affect text and 
content.
  
   My screens are essentially composite views or possibly composites 
of views - one screen may have controls that interact with more than one 
device.


   I am trying to decide about arrangment of my Models Views and 
Controllers. 

   Essentially my components will be grouped into Views, but I do not 
know whether it is a good or bad idea to mix controls for different 
devices within a single view.  Also, is it better to have a single 
controller responding to messages from all views to route these to the 
appropriate model, or should I create a controller for each view.  I am 
thinking the latter would be overkill possibly, but I am still not sure 
whether to create a composite of controllers, or separate them, use 
simple commands and some kind of factory / lookup, etc. - some 
component events will be routed to devices, some to the application, etc.
   At the other side of the controller, my models will be for instances 
of devices and will send updates to the backend  other bits of the 
app.  Is it better here to send these updates directly to all the views 
or a controller(s), or is this choice affected by others above?


   The other question is, do I lever the existing Flash event mechanism 
for communications across the app, or will this slow it down - is it 
better to use basic observer for the model updating other things???


   I have looked at a number of frameworks and the idea of PureMVC with 
it's very loosely coupled elements seems very sensible.  As most of the 
frameworks are constraining in some way and I need the experience, I am 
hedging towards designing my own framework here to fit in with the 
requirements above - mainly, getting component interaction to the back 
end as fast as possible.   In the current AS1 functional type code the 
button onRelease, etc. functions are pretty much wired directly to 
sending of data over the wire.  Whilst this is good (fast), the 
maintainability of the project is not.  Different wiring, change to 
spec's, etc. the bits I am trying to clean up along with porting to AS3 
/ AVM2.


   Does anyone have any advice here particularly with regard as to how 
to layout my MVC'ness - can I enclose entire MVC elements within another 
M, V or C, or do I nest M-in-M, etc???


   Thanks in advance.

   Glen
  
  
___

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


[Flashcoders] Printing table receipt with Flex

2009-02-26 Thread Omar Fouad
Hi all,I am working on a POS application in AIR and SQLite, and I am stuck
with this little problem. I need to send to a printer, some data from an
array and create a table.. in other words, I need to print a receipt.

Is there any way to create dinamically a table and fill it with strings and
print it out?

Thanks in advance

-- 
Omar M. Fouad - ActionScript Developer
www.omar-fouad.net
Cellular: (+20) 1011.88.534
Mail: m...@omar-fouad.net

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] MVC(S) Question

2009-02-26 Thread dr.ache

Hi Glen.
I would defenitively go with lose coupling and one controller by one 
device.
You mentioned one requirement being the scaleability what new views are 
concerned - so there is no others choice.
To proof the speed of that setup you need to implement a prototype of a 
likely application state. How should someone else know?
But as a general tip: Always go with the better architecture - the speed 
comes with better hardware (or flash player).


Glen Pike schrieb:

Hi,

   I am reworking an application we use for a touchscreen interface 
and am trying to design the architecture for all the right reasons.


   I am currently wrangled in MVC-ness and trying to work out the best 
way to move forward.  Having immersed myself in many books and texts, 
I still find myself going around in circles some of the time and would 
like to make some choices with possible help from you guys...
 
   The app talks to a back end control system via an XML socket.  The 
system has a number of devices attached and the screen controls allow 
for changing stuff on the devices and monitoring them too along with 
the application navigation, etc.


   Requirements:
   It be easy to add new screens later on.
   The coupling of component interaction to back end needs to be 
fairly fast - we use sliders and trackpads to move devices in real-ish 
time.
   The application may use different languages which affect text and 
content.
 My screens are essentially composite views or possibly 
composites of views - one screen may have controls that interact with 
more than one device.


   I am trying to decide about arrangment of my Models Views and 
Controllers.
   Essentially my components will be grouped into Views, but I do not 
know whether it is a good or bad idea to mix controls for different 
devices within a single view.  Also, is it better to have a single 
controller responding to messages from all views to route these to the 
appropriate model, or should I create a controller for each view.  I 
am thinking the latter would be overkill possibly, but I am still not 
sure whether to create a composite of controllers, or separate them, 
use simple commands and some kind of factory / lookup, etc. - some 
component events will be routed to devices, some to the application, etc.
   At the other side of the controller, my models will be for 
instances of devices and will send updates to the backend  other bits 
of the app.  Is it better here to send these updates directly to all 
the views or a controller(s), or is this choice affected by others above?


   The other question is, do I lever the existing Flash event 
mechanism for communications across the app, or will this slow it down 
- is it better to use basic observer for the model updating other 
things???


   I have looked at a number of frameworks and the idea of PureMVC 
with it's very loosely coupled elements seems very sensible.  As most 
of the frameworks are constraining in some way and I need the 
experience, I am hedging towards designing my own framework here to 
fit in with the requirements above - mainly, getting component 
interaction to the back end as fast as possible.   In the current AS1 
functional type code the button onRelease, etc. functions are pretty 
much wired directly to sending of data over the wire.  Whilst this is 
good (fast), the maintainability of the project is not.  Different 
wiring, change to spec's, etc. the bits I am trying to clean up along 
with porting to AS3 / AVM2.


   Does anyone have any advice here particularly with regard as to how 
to layout my MVC'ness - can I enclose entire MVC elements within 
another M, V or C, or do I nest M-in-M, etc???


   Thanks in advance.

   Glen
___
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] Printing table receipt with Flex

2009-02-26 Thread Eric E. Dolecki
Could you use some temporary HTML to do that and write the HTML internally?

On Thu, Feb 26, 2009 at 8:50 AM, Omar Fouad omarfouad@gmail.com wrote:

 Hi all,I am working on a POS application in AIR and SQLite, and I am stuck
 with this little problem. I need to send to a printer, some data from an
 array and create a table.. in other words, I need to print a receipt.

 Is there any way to create dinamically a table and fill it with strings and
 print it out?

 Thanks in advance

 --
 Omar M. Fouad - ActionScript Developer
 www.omar-fouad.net
 Cellular: (+20) 1011.88.534
 Mail: m...@omar-fouad.net

 This e-mail and any attachment is for authorised use by the intended
 recipient(s) only. It may contain proprietary material, confidential
 information and/or be subject to legal privilege. It should not be copied,
 disclosed to, retained or used by, any other party. If you are not an
 intended recipient then please promptly delete this e-mail and any
 attachment and all copies and inform the sender. Thank you.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
http://ericd.net
Interactive design and development
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Printing table receipt with Flex

2009-02-26 Thread Glen Pike

Omar Fouad wrote:

Hi all,I am working on a POS application in AIR and SQLite, and I am stuck
with this little problem. I need to send to a printer, some data from an
array and create a table.. in other words, I need to print a receipt.

Is there any way to create dinamically a table and fill it with strings and
print it out?

Thanks in advance

  

Hi,

   Not sure about the dynamic table, but you can use the PrintJob class 
in ActionScript.  The best thing to do with this is to create a 
MovieClip the size of the thing to print and put a Bitmap inside it.  Do 
a grab of your Receipt table / MovieClip into the bitmap and use the 
PrintJob to print - this gets around problems with vector vs bitmap in 
printing because you are always printing a bitmap.  As long as you have 
a way of laying out your receipt you can print it from AS if you like...


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


Re: [Flashcoders] How to know coordinates of letters in non fixed-width fonts

2009-02-26 Thread ali drongo
Thanks guys, I got it working :) The text is slightly badly aligned
sometimes, I'm going to look into Line Metrics and aliasing as it's only a
pixel or so out as the text is v small.Many many thanks again
Ali



On Wed, Feb 25, 2009 at 7:42 AM, Matt Gitchell m...@moonbootmedia.comwrote:

 TextField has a getLineMetrics() function, which returns a TextLineMetrics
 object.
 Check out the AS3 Reference stuff for TextField and the TextLineMetrics
 class for the breakdown, there's all kinds of good, fun stuff in there.

 --Matt

 On Tue, Feb 24, 2009 at 6:36 AM, Glen Pike g...@engineeredarts.co.uk
 wrote:

  Hi,
 
Can you get text metrics for characters / lines in the text field???
 
Glen
 
 
  ali drongo wrote:
 
  Thanks for all of your responses guys,I ended up using getCharBoundaries
  and
  it works a treat.
  FYI I created a text field at the position I wanted the letters to
 finally
  go then stored the rectangle object for each char in an array and then
  cycled through the array as Glen suggested.
 
  Only thing is, when I use a multiline textfield my function will only
  gather
  the char boundaries for the first line:
  If anyone can suggest why it would be a help.
  Cheers!
  Ali
 
 
 
 
  public static function letterPosAr(t:TextField):Array
  {
  trace(letterPosAr);
  var retA:Array = new Array();
  for (var i:int = 0; i  t.text.length; i++){
  var rect:Rectangle = t.getCharBoundaries(i);
  trace(---index+i+  char:+t.text.substr(i, 1)+  x:+rect.x+
  y:+rect.y+ w:+rect.width);
  retA[i] = rect;
  }
  return retA;
   }
 
  On Tue, Feb 24, 2009 at 7:02 AM, Matt Gitchell m...@moonbootmedia.com
  wrote:
 
 
 
  the AS2 one is a cool idea!
 
  On Mon, Feb 23, 2009 at 10:16 PM, Hans Wichman 
  j.c.wich...@objectpainters.com wrote:
 
 
 
  and for as2:
 
 http://objectpainters.com/blog/2008/10/12/finding-character-positions/
 
  On Tue, Feb 24, 2009 at 1:24 AM, Matt Gitchell 
 m...@moonbootmedia.com
 
 
  wrote:
 Is this AS3? you can use TextField.getCharBoundaries()
 
  I used it in an experiment a while back here to pretty good effect:
  http://www.moonbootmedia.com/interactive/m/textcompare.html
 
  --Matt
 
 
 
  On Mon, Feb 23, 2009 at 3:01 PM, Glen Pike 
 postmas...@glenpike.co.uk
 
 
  wrote:
   Hi,
 
   You should be able to get the width of each sprite with the single
 
 
  letter
 
 
  in???
 
   Maybe mask the stream area out.  Start each letter at x -
 
 
  letterWidth,
 
 
  increase the x after each interval, when the letter reaches x=0,
 
 
  create
 
 
  
 
 
  show the next one, add it to your array.
 Loop through the array each timer increasing the x position of
 
 
  the
 
 
  letters, removing them when they reach the other side???
 Something like that??/
 Glen
 
  ali drongo wrote:
 
 
 
  Hi there, I'm animating some letters that are dynamically created
 in
 
 
  their
 
 
  own sprites across the screen as if they are being fired in a
 
 
  stream.
 
 
  Currently I am using a fixed width font so it's straight forward to
 
 
  find
 
 
  their final position. My problem is that I need to use a non
 
 
  fixed-width
 
 
  font and I don't know how to calculate the position of each letter.
 
  Any ideas very gratefully received!
 
  Thanks :)
  Ali
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 
 
 
 
  --
 
  Glen Pike
  01326 218440
  www.glenpike.co.uk http://www.glenpike.co.uk
 
  ___
  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
 
 
 
  ___
  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
 
 ___
 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] Printing table receipt with Flex

2009-02-26 Thread Anthony Pace
You beat me to it.  I was going to say that he could lat it out someway 
like outputing it all as html inside an mc like eric said,  convert the 
mc to a bitmap like you suggested, and then use printJob();


Here is a decent tutorial...

http://blog.tikikitchen.com/2008/04/18/printing-in-flash-in-10-simple-steps



Glen Pike wrote:

Omar Fouad wrote:
Hi all,I am working on a POS application in AIR and SQLite, and I am 
stuck

with this little problem. I need to send to a printer, some data from an
array and create a table.. in other words, I need to print a receipt.

Is there any way to create dinamically a table and fill it with 
strings and

print it out?

Thanks in advance

  

Hi,

   Not sure about the dynamic table, but you can use the PrintJob 
class in ActionScript.  The best thing to do with this is to create a 
MovieClip the size of the thing to print and put a Bitmap inside it.  
Do a grab of your Receipt table / MovieClip into the bitmap and use 
the PrintJob to print - this gets around problems with vector vs 
bitmap in printing because you are always printing a bitmap.  As long 
as you have a way of laying out your receipt you can print it from 
AS if you like...


   Glen
___
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] MVC(S) Question

2009-02-26 Thread Anthony Pace

Dr. Ache,

This isn't about your advice on the app, as I think you are right with 
regard to his situation (I am just starting to get better with real oop 
so don't quote me); yet, it is the comment, that you should always use 
loose coupling, that gets me.  Doesn't tight coupling use less cycles 
and memory since you don't need so many listeners? Are not event 
listeners are essentially loops that test for a change in a variable on 
a consistent basis?  What if an app had to run on a Pentium 633 (my old 
pc) and it had a hundred listeners?


I have been in and watched lectures and read papers where the big boys 
of scientific computing/mainframe/webapps (IBM/Google/Yahoo) try to get 
their gigantic applications as tight as possible when speed is a real 
concern.  They say that you should use tight coupling whenever you can 
get away with it and speed is the real goal; yet, loose coupling when 
primary concern is scalability; however, they always say a balance 
between the two makes for better applications.


Again I state I am just starting to get involved in this argument, so I 
hope I will be forgiven if I am talking out my backside.


Waiting to flamed,
Anthony


dr.ache wrote:

Hi Glen.
I would defenitively go with lose coupling and one controller by one 
device.
You mentioned one requirement being the scaleability what new views 
are concerned - so there is no others choice.
To proof the speed of that setup you need to implement a prototype of 
a likely application state. How should someone else know?
But as a general tip: Always go with the better architecture - the 
speed comes with better hardware (or flash player).


Glen Pike schrieb:

Hi,

   I am reworking an application we use for a touchscreen interface 
and am trying to design the architecture for all the right reasons.


   I am currently wrangled in MVC-ness and trying to work out the 
best way to move forward.  Having immersed myself in many books and 
texts, I still find myself going around in circles some of the time 
and would like to make some choices with possible help from you guys...
 
   The app talks to a back end control system via an XML socket.  The 
system has a number of devices attached and the screen controls allow 
for changing stuff on the devices and monitoring them too along with 
the application navigation, etc.


   Requirements:
   It be easy to add new screens later on.
   The coupling of component interaction to back end needs to be 
fairly fast - we use sliders and trackpads to move devices in 
real-ish time.
   The application may use different languages which affect text and 
content.
 My screens are essentially composite views or possibly 
composites of views - one screen may have controls that interact with 
more than one device.


   I am trying to decide about arrangment of my Models Views and 
Controllers.
   Essentially my components will be grouped into Views, but I do not 
know whether it is a good or bad idea to mix controls for different 
devices within a single view.  Also, is it better to have a single 
controller responding to messages from all views to route these to 
the appropriate model, or should I create a controller for each 
view.  I am thinking the latter would be overkill possibly, but I am 
still not sure whether to create a composite of controllers, or 
separate them, use simple commands and some kind of factory / 
lookup, etc. - some component events will be routed to devices, some 
to the application, etc.
   At the other side of the controller, my models will be for 
instances of devices and will send updates to the backend  other 
bits of the app.  Is it better here to send these updates directly to 
all the views or a controller(s), or is this choice affected by 
others above?


   The other question is, do I lever the existing Flash event 
mechanism for communications across the app, or will this slow it 
down - is it better to use basic observer for the model updating 
other things???


   I have looked at a number of frameworks and the idea of PureMVC 
with it's very loosely coupled elements seems very sensible.  As most 
of the frameworks are constraining in some way and I need the 
experience, I am hedging towards designing my own framework here to 
fit in with the requirements above - mainly, getting component 
interaction to the back end as fast as possible.   In the current AS1 
functional type code the button onRelease, etc. functions are pretty 
much wired directly to sending of data over the wire.  Whilst this is 
good (fast), the maintainability of the project is not.  Different 
wiring, change to spec's, etc. the bits I am trying to clean up along 
with porting to AS3 / AVM2.


   Does anyone have any advice here particularly with regard as to 
how to layout my MVC'ness - can I enclose entire MVC elements within 
another M, V or C, or do I nest M-in-M, etc???


   Thanks in advance.

   Glen
___
Flashcoders mailing 

Re: [Flashcoders] MVC(S) Question

2009-02-26 Thread dr.ache

Hi Anthony.

Thats the point. When it really comes to hard performance issues, eg. 
games or other extrem algorithms, you cannot go without
coding more coupled. But as I said: Build (and build it with good coding 
styles) a prototype of the app where you expect to have
the bottleneck in terms of performance. But only then optimize that part 
of code and keep everything else in shape, meaning good
oop style architecture... there are only small parts of the entire 
system that need to run as fast as possible. And when you have coded
right that part is a module of the system (which you can then test in 
isolation)..


And events do NOT check a variable in a loop. The complete opposite is 
true. They only occur when something happens, like a
mouseclick or another state change when you setup an individual event. 
Sure, when you fire an event when a variable changes and you change the 
variable every frame... :-)

but that should not happen :)

And this loose coupling thing is just an idea, a thing you should 
strive for... but there are enough situations in which lose coupling
is neither the best way nor possible. I do recomment you Head First 
Design Pattern if you are interested in this topic. Its not the

newest but still very intuitive and funny(in a good way) to read.

Cheers 




Anthony Pace schrieb:

Dr. Ache,

This isn't about your advice on the app, as I think you are right with 
regard to his situation (I am just starting to get better with real 
oop so don't quote me); yet, it is the comment, that you should always 
use loose coupling, that gets me.  Doesn't tight coupling use less 
cycles and memory since you don't need so many listeners? Are not 
event listeners are essentially loops that test for a change in a 
variable on a consistent basis?  What if an app had to run on a 
Pentium 633 (my old pc) and it had a hundred listeners?


I have been in and watched lectures and read papers where the big boys 
of scientific computing/mainframe/webapps (IBM/Google/Yahoo) try to 
get their gigantic applications as tight as possible when speed is a 
real concern.  They say that you should use tight coupling whenever 
you can get away with it and speed is the real goal; yet, loose 
coupling when primary concern is scalability; however, they always say 
a balance between the two makes for better applications.


Again I state I am just starting to get involved in this argument, so 
I hope I will be forgiven if I am talking out my backside.


Waiting to flamed,
Anthony


dr.ache wrote:

Hi Glen.
I would defenitively go with lose coupling and one controller by one 
device.
You mentioned one requirement being the scaleability what new views 
are concerned - so there is no others choice.
To proof the speed of that setup you need to implement a prototype of 
a likely application state. How should someone else know?
But as a general tip: Always go with the better architecture - the 
speed comes with better hardware (or flash player).


Glen Pike schrieb:

Hi,

   I am reworking an application we use for a touchscreen interface 
and am trying to design the architecture for all the right reasons.


   I am currently wrangled in MVC-ness and trying to work out the 
best way to move forward.  Having immersed myself in many books and 
texts, I still find myself going around in circles some of the time 
and would like to make some choices with possible help from you guys...
 
   The app talks to a back end control system via an XML socket.  
The system has a number of devices attached and the screen controls 
allow for changing stuff on the devices and monitoring them too 
along with the application navigation, etc.


   Requirements:
   It be easy to add new screens later on.
   The coupling of component interaction to back end needs to be 
fairly fast - we use sliders and trackpads to move devices in 
real-ish time.
   The application may use different languages which affect text and 
content.
 My screens are essentially composite views or possibly 
composites of views - one screen may have controls that interact 
with more than one device.


   I am trying to decide about arrangment of my Models Views and 
Controllers.
   Essentially my components will be grouped into Views, but I do 
not know whether it is a good or bad idea to mix controls for 
different devices within a single view.  Also, is it better to have 
a single controller responding to messages from all views to route 
these to the appropriate model, or should I create a controller for 
each view.  I am thinking the latter would be overkill possibly, but 
I am still not sure whether to create a composite of controllers, or 
separate them, use simple commands and some kind of factory / 
lookup, etc. - some component events will be routed to devices, some 
to the application, etc.
   At the other side of the controller, my models will be for 
instances of devices and will send updates to the backend  other 
bits of the app.  Is it better here to send 

Re: [Flashcoders] Printing table receipt with Flex

2009-02-26 Thread Omar Fouad
Thanks everybody for the replies... I've been thinking about rendering an
HTML table into a TextField inside a sprite... But as far as I know,
TextFields in flash does not support HTML tables.

What else is recomended?

On Thu, Feb 26, 2009 at 7:52 PM, Anthony Pace anthony.p...@utoronto.cawrote:

 You beat me to it.  I was going to say that he could lat it out someway
 like outputing it all as html inside an mc like eric said,  convert the mc
 to a bitmap like you suggested, and then use printJob();

 Here is a decent tutorial...


 http://blog.tikikitchen.com/2008/04/18/printing-in-flash-in-10-simple-steps




 Glen Pike wrote:

 Omar Fouad wrote:

 Hi all,I am working on a POS application in AIR and SQLite, and I am
 stuck
 with this little problem. I need to send to a printer, some data from an
 array and create a table.. in other words, I need to print a receipt.

 Is there any way to create dinamically a table and fill it with strings
 and
 print it out?

 Thanks in advance



 Hi,

   Not sure about the dynamic table, but you can use the PrintJob class in
 ActionScript.  The best thing to do with this is to create a MovieClip the
 size of the thing to print and put a Bitmap inside it.  Do a grab of your
 Receipt table / MovieClip into the bitmap and use the PrintJob to print -
 this gets around problems with vector vs bitmap in printing because you are
 always printing a bitmap.  As long as you have a way of laying out your
 receipt you can print it from AS if you like...

   Glen
 ___
 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




-- 
Omar M. Fouad - ActionScript Developer
www.omar-fouad.net
Cellular: (+20) 1011.88.534
Mail: m...@omar-fouad.net

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders