all groups > macromedia flash handhelds > january 2005 >
You're in the

macromedia flash handhelds

group:

Pocket Pc Help


Pocket Pc Help GeorgeWS
1/20/2005 10:40:05 PM
macromedia flash handhelds:
I have this app. There is a drop down box dynamicaly populated. It works ok on
my pocketPC but only if it syncs up. How can I load the selection in to a
SharedObject (im thinking) and then I could use the app unconnected? My next
problem is that I dont know hoe to have other selections get added to the grid
im using as the 'Cart' I then want to send the items that get added using and
add button (add_pb) to the grid (cart_dg) I have a send button (buy_pb) The
adding of the items works ok and the saving to the device works good but the
send from the device does not seem to work even in the craddle connected. But
it does work in the runtime environment (Ctrl/Shift). Can anyone help me with
any of this? Thanks, George

/***********************************************
included ActionScript files
***********************************************/
#include "NetServices.as"
#include "NetDebug.as"

var gateway="http://www.youngsmarket.com/flashservices/gateway";

var remoteProd="PocketPC.Products";

var remoteDist=" PocketPC.Distributor";

var remoteCart=" PocketPC.Carts";

/***********************************************
object constructors and object creation
***********************************************/

var prodResponder=new Object();

var cartResponder=new Object();

/***********************************************
functions and object methods
***********************************************/
cartResponder.onResult=function(result)
{
confirm_txt.text="Your confirmation number is "+result;
}

function objectFormatter(theObj,labelname)
{
var dataObj=new Object();
dataObj.label=theObj[labelname];
dataObj.data=theObj;
return dataObj;
}

prodResponder.onResult=function(result)
{
var prod_array=new Array();
for (var i=0;i<result.length;i++)
{
prod_array[i]=objectFormatter(result[i],"MBRANS");
}
prod_cb.setDataProvider(prod_array);
}

this.onStatus=function(result)
{
trace(result.description);
prod_cb.addItem("Error loading");
}

cart_dg.addToCart=function()
{
var newItem=true;

var num=this.getLength();

for (var i=0;i<=num;i++)
{
if(this.getItemAt(i).MBABRD==prod_cb.getSelectedItem().data.MBABRD)
{
newItem=false;
this.setCellData(i,"Quantity",Number(this.getItemAt(i).quantity)+1);
break;
}
}


if (newItem)
{

cart_dg.addItem(prod_cb.getSelectedItem().data);

this.setCellData(num,"Quantity",1);
}

trash_mc._alpha=100;
}
cart_dg.deleteItem=function(){
this.removeItemAt(this.getSelectedIndex());

}
cart_dg.saveCart=function()
{
cart_so.data.cart_array=new Array();
for (var i=0;i<cart_dg.getLength();i++)
{
cart_so.data.cart_array[i]=cart_dg.getItemAt(i);
}
cart_so.flush();
confirm_txt.text="Info saved!"
}

cart_dg.buy=function()
{
// create an array to hold the item objects
var cart_array=new Array();
// hardcode distributor ID
var distID=3;
// get the length of the cart (number of items)
var numItems=cart_dg.getLength();
// populate the array with the cart item objects
for (var i=0;i<numItems;i++)
{
cart_array[i]=cart_dg.getItemAt(i);
}
// call the buyCart method of the cart service
cartResponder.cartService.buyCart(cart_array,distID);
}
trash_mc.onRelease=function()
{
cart_dg.deleteItem();
}*/

/***********************************************
run at once commands
***********************************************/
NetServices.setDefaultGatewayURL(gateway);
var net_conn=NetServices.createGatewayConnection();

prodResponder.prodService=net_conn.getService(remoteProd,prodResponder);
prodResponder.prodService.getAll();
// populate product ListBox
prod_lb.addItem("Loading...");

// create proxy object for remote Cart service
cartResponder.cartService=net_conn.getService(remoteCart,cartResponder);

// skin all components
globalStyleFormat.selection=0x95FFAA;
globalStyleFormat.applyChanges();
// set click handler for add_pb
add_pb.setClickHandler("addToCart",cart_dg);
// Set columns to display in DataGrid
cart_dg.setColumns("MBRANS","POS");
// Set column headers
cart_dg.getColumnAt(0).setHeader("Product");
//cart_dg.getColumnAt(1).setHeader("Price");
// Add new columns to the DataGrid
var newCol=new FGridColumn("Quantity");
cart_dg.addColumn(newCol);

// set column widths
cart_dg.getColumnAt(0).setWidth(130);
//cart_dg.getColumnAt(1).setWidth(60);
cart_dg.getColumnAt(2).setWidth(60);
cart_dg.getColumnAt(3).setWidth(60);
// make quantity column editable
cart_dg.setEditable(true);
cart_dg.getColumnAt(0).setEditable(false);
//cart_dg.getColumnAt(1).setEditable(false);
cart_dg.getColumnAt(3).setEditable(false);
// format DataGRid appearance
cart_dg.alternateRowColors(0xffffff,0xECFFEC);
// set FStyleFormat object properties
cart_dg.setStyleProperty("header",0xBFD5FF);
//cart_dg.getColumnAt(3).setStyleProperty("textAlign","right");
// create or find a shared object in the local drive
cart_so=SharedObject.getLocal("cartInfo");
// set click handler for save_pb, also added to stage in this wt
save_pb.setClickHandler("saveCart",cart_dg);
// autosize a dynamic message field for confirmations
confirm_txt.autosize=true;
// length of array of products in sharedobject array
var soNum=cart_so.data.cart_array.length;
// check to see if any items in shared object, if there are, add them to the
cart
if (soNum>0)
{
for (var i=0;i<soNum;i++)
{
cart_dg.addItem(cart_so.data.cart_array[i]);
}
cart_dg.totalCart();
}
// set clickHandler for buy_pb
buy_pb.setClickHandler("buy",cart_dg);

trash_mc._alpha=20;
Re: Pocket Pc Help slamdunkinpool
1/21/2005 8:26:47 AM
Are you using M Flash 2004?
Re: Pocket Pc Help GeorgeWS
1/21/2005 3:42:32 PM
Re: Flash 7 for Windows CE? Bill Perry
2/28/2005 7:32:02 AM
We can't comment on any future products. If you have a specific reason why you would need Flash 7 for Windows CE please post it here.

Re: Flash 7 for Windows CE? sneakyimp
3/2/2005 2:55:38 PM
I would LOVE LOVE LOVE to have a windows CE version of flash today. I'm doing
some contract work for a company that sells GPS equipment for construction
work. They also make their own handheld devices. The work they want me to do
is for a conference. They are doing a giveaway at the conference...they are
handing out several thousand magnetic cards. They want to connect a USB card
swiper (or RS232 card swiper) to their handheld device so people can swipe
their cards to determine a winner.

I haven't been able to write a custom application for their device (i just got
the SDK yesterday--getting visual studio working is difficult AND
EXPENSIVE--and the app is due on friday) but i HAVE managed to write a
flash/PHP app that communicates with an EEPROM card reader. My contact there
is setting up a mac laptop with apache and php. the card swiper inputs text to
the keyboard buffer, flash reads the key input and sends queries to the
php/apache on the laptop which either queries a database or writes a data file
to keep track of cards that have been swiped to prevent cheaters.

if there was flash for winCE, they could use one of their devices. would be
SO COOL.


Re: Flash 7 for Windows CE? slamdunkinpool
3/5/2005 5:52:42 AM
Hi, Microsoft's embedded Visual Basic/C++ 4.x are free tools. You should
download them from microsoft website it comes with the emulator. What's
stopping you from using html/php to read data from EEPROM. I think in your case
eVB will be best. If you can afford Visual Studio.NET then C# will be better.
Please let us know as to what solution you choosed and also if you faced any
paritcular difficulties.
Re: Flash 7 for Windows CE? sneakyimp
3/6/2005 12:54:08 AM
That's actually a good plan...very good suggestion. I may actually try that.
My *real* problem has to do with keyboard drivers and is not directly related
to flash.

As it turns out, there are a few different hand-held computers i can work
with. the only one that seems to have a USB driver compatible with my EEPROM
card reader is, unfortunately, the old clunky black & white one that's quite
large. the new FC100 model doesn't have HID-compliant USB drivers so my card
reader can't really talk to it.

i have a serial port card reader and i have Embedded Visual C++. I just
managed to get my first "hello world" app running on the FC100 (color screen
and all) and I'm planning to have a crack at writing a special application to
open up and listen to the serial port for card swipes. Problem here is that my
C++ skills are rustier than the wreck of the Edmund Fitzgerald. Also, embedded
C++ doesn't actually offer robust graphic design tools. I've seen the C++ code
that draws windows and such but i haven't yet figured out how to import
graphics. It's a rather daunting task.

Bottom line is that flash is so handy for making an active, attractive client.
I don't have to get mired in writing all kinds of html and javascript to parse
eeprom input. I think I'm stuck writing C++ code. Wish i had visual studio
but it's very expensive.
Re: Flash 7 for Windows CE? slamdunkinpool
3/10/2005 9:28:43 AM
You can also try Java, the free NetBeans IDE(optional download in J2SE 1.5)
from Sun has templates and support for mobile devices. Writing code in java
will be slightly easier than in C++. For java based solution also search for
superwaba(free) and waba. You can develop superwaba based solution using plugin
in eclipse IDE (free). I believe the card-reader works like a keyboard so if
you have a focus on text input field and then you swipe the card. The contents
of the card will show up in text field. There is a free c# sharpDevelop IDE
available which I used a while back. Not sure if it has support for Compact
Framework and CE. -slamdunk
AddThis Social Bookmark Button