Re: [flexcoders] Re: Using arraycollection as text for a flex TextArea Component.

2011-12-27 Thread claudiu ursica
Actually I should show the last one. 

try

txt += entry.OrderNumber +   + , +   + entry.Produ then the string 
will have all the entries added not replaced.

C




 From: ZIONIST stinas...@yahoo.com
To: flexcoders@yahoogroups.com 
Sent: Tuesday, December 27, 2011 6:04 AM
Subject: [flexcoders] Re: Using arraycollection as text for a flex TextArea 
Component.
 

  
This is what i have come up with some far... Problem is that it only outputs 
the first entry in the ArrayCollection. So if a client selects more than one
item to buy, when he/she previews their selection, they will only see the first 
entry. Could someone please help me modify this to show all the entries
in the ArrayCollection.

[Bindable]
private var orderColl:ArrayCollection=new ArrayCollection();

/*** Create an object to hold the data ***/
var obj:Object=new Object();

/*** Assign the variables to it ***/
obj.Product=product.text;
obj.Price=price.text;
obj.Qty=1;
obj.OrderNumber=label1.text;

/*** Add the object to the list ***/
orderColl.addItemAt(obj, 0);

Then i have a TextArea component (id=cart) and i try to assign the 
arraycollection to it as text like this

var txt:String;
var n:int=orderColl.length;
for (var i:int=0; i  n; i++)
{
var entry:Object=orderColl.getItemAt(i);
txt = entry.OrderNumber +   + , +   + entry.Product +   + , +   + 
entry.Qty +   + , +   + entry.Price;
}
cart.text = txt.toString();


 

Re: [flexcoders] Resize and Scale Window Content

2011-12-27 Thread claudiu ursica
Can you show some code?
C




 From: Isabelle Loyer Perso isa_lo...@yahoo.fr
To: flexcoders@yahoogroups.com 
Sent: Tuesday, December 27, 2011 3:51 PM
Subject: Re: [flexcoders] Resize and Scale Window Content
 

  
Hi,
I have the same problem.
I use groupe with percent height and width. But this doesn't work if
window is resize by as3 script during creationcomplete phase.
If someone has an idea?
thanks

Le 27/12/11 07:54, Asad Zaidi a écrit : 
  
you can acheive it using Grid control also. depends upon your requirement.
 
Zaidi


From: claudiu ursica the_bran...@yahoo.com
To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com 
Sent: Tuesday, December 27, 2011 3:28 AM
Subject: Re: [flexcoders] Resize and Scale Window Content


  
In theory yes, by using percent width and height for components, in practice 
how much works out of the box depeds on every particular case.


C



From: hkondylk kondy...@gmail.com
To: flexcoders@yahoogroups.com 
Sent: Monday, December 26, 2011 5:35 PM
Subject: [flexcoders] Resize and Scale Window Content


  
Hello, 

I want to be able to resize my
  Window and the content to scale as
  the window resizes. Is this
  possible or do you have an
  example?

THanks in advnace.






 

Re: [flexcoders] Resize and Scale Window Content

2011-12-27 Thread Isabelle Loyer Perso













Re: [flexcoders] Re: Bug in C function caused AIR to crash

2011-12-27 Thread James Ong
Hi, someone just fixed my code, it working fine.
But how do I inspect in Flex Builder where I have installed CDT and MingGW?



On Tue, Dec 27, 2011 at 9:59 PM, Tomislav i...@svemir.net wrote:

 **


 Did you try inspecting FREResut values from FREGetObjectAsUTF8 calls?

 FREREsult res = FRENewObjectFromUTF8(strlen(strAll)+1, (uint8_t *)strAll,
 result);
 printf(%d, res );


 --- In flexcoders@yahoogroups.com, yanlilei64 yanlilei64@... wrote:
 
  No one know?
 
 
  --- In flexcoders@yahoogroups.com, yanlilei64 yanlilei64@ wrote:
  
   I want to pass the James string to getTestString function, the first
   time, the string could return This is James without any error.
   Subsequently after the button is click, the application will just
   hang/crash (grey out), it seem there some bugs in this code?
  
   Screenshot: http://imagetwist.com/7896zupwtu97/a.jpg.html
  
   Code:
  
   FREObject getTestString(FREContext ctx, void* funcData, uint32_t argc,
   FREObject argv[]) {
   FREObject result;
  
   //Temporary values to hold our actionscript code.
   uint32_t albumLength;
   const uint8_t *str;
   uint8_t *strAll;
  
   //Turn our actionscrpt code into native code.
   FREGetObjectAsUTF8(argv[0], albumLength, str);
   strcpy(strAll,This is );
   strcat(strAll,str); //str is James
  
   //const char *str = this is ;
   FRENewObjectFromUTF8(strlen(strAll)+1, (uint8_t *)strAll,
   result); //UTF8 to object and return
  
   return result;
   }
  
 

  



Re: [flexcoders] Resize and Scale Window Content

2011-12-27 Thread Asad Zaidi
you can acheive it using Grid control also. depends upon your requirement.
 
Zaidi



From: claudiu ursica the_bran...@yahoo.com
To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com 
Sent: Tuesday, December 27, 2011 3:28 AM
Subject: Re: [flexcoders] Resize and Scale Window Content


  
In theory yes, by using percent width and height for components, in practice 
how much works out of the box depeds on every particular case.

C




From: hkondylk kondy...@gmail.com
To: flexcoders@yahoogroups.com 
Sent: Monday, December 26, 2011 5:35 PM
Subject: [flexcoders] Resize and Scale Window Content


  
Hello, 

I want to be able to resize my Window and the content to scale as the window 
resizes. Is this possible or do you have an example?

THanks in advnace.






[flexcoders] Re: Using arraycollection as text for a flex TextArea Component.

2011-12-27 Thread ZIONIST
That works well. It actually outputs the contents of the arraycollection in the 
textarea component. One very small issue though, it outputs the word NULL 
before the last item in the arraycollection. How do i get rid of that?

Below is the update.

[Bindable]
private var orderColl:ArrayCollection=new ArrayCollection();

/*** Create an object to hold the data ***/
var obj:Object=new Object();

/*** Assign the variables to it ***/
obj.Product=product.text;
obj.Price=price.text;
obj.Qty=1;
obj.OrderNumber=label1.text;

/*** Add the object to the list ***/
orderColl.addItemAt(obj, 0);

Then i have a TextArea component (id=cart) and i try to assign the 
arraycollection to it as text like this

var txt:String;
var n:int=orderColl.length;
for (var i:int=0; i  n; i++)
{
var entry:Object=orderColl.getItemAt(i);
txt += entry.OrderNumber + , ++ entry.Product + , ++ entry.Qty 
++ Unit + ( + s + ) + , ++ $ + entry.Price ++ 
per unit + \n\n;
}
cart.text = txt;



[flexcoders] C Native Extension: Need to replace time structure into millisecond output

2011-12-27 Thread yanlilei64
I'm taking time to experiment how I can track the MIDI timing in milliseconds. 
In this code below contain date and time format and wish to replace with time 
function that is capable of milliseconds precision without huge jump in 
accuracy. This will be run on Window 7 using GCC or MingGW compilers.
Any advice is appreciate!


#include FlashRuntimeExtensions.h
#include Stdlib.h
#include SampleANE.h
#include String.h
#include time.h

//If AIR can access this function, return 1, ANE is avail
FREObject isSupported(FREContext ctx, void* funcData, uint32_t argc, FREObject 
argv[]) {
FREObject result;

uint32_t isSupportedInThisOS = 1;
FRENewObjectFromBool(isSupportedInThisOS, result); 
//Boolean to object and return, FRE_OK

return result;
}

FREObject getTestString(FREContext ctx, void* funcData, uint32_t argc, 
FREObject argv[]) {
FREObject result = 0;

//Temporary values to hold our actionscript code.
uint32_t len = -1;
const uint8_t *str = 0;
char *temp;
uint8_t *strAll;

time_t curtime;
struct tm *loctime;

curtime = time(NULL);

loctime = malloc(sizeof(curtime));

loctime = localtime(curtime);

char *asc = asctime(loctime);

//Turn our actionscrpt code into native code.
if(FREGetObjectAsUTF8(argv[0], len, str) == FRE_OK) {
temp = Hello World! This is ;

strAll = (char *)malloc(strlen(temp) + strlen(str) + 
strlen(asc) + 1);
strcpy(strAll,temp);
strcat(strAll,str);
strcat(strAll,asctime(loctime));
}

FRENewObjectFromUTF8(strlen((const char *)strAll)+1, (const uint8_t 
*)strAll, result); //UTF8 to object and return
free(strAll);
free(temp);

return result;
}

FREObject getHelloWorld(FREContext ctx, void* funcData, uint32_t argc, 
FREObject argv[]) {
FREObject result;

const char *str = Hello World! This is a String;
FRENewObjectFromUTF8(strlen(str)+1, (const uint8_t *)str, result);

return result;
}


void contextInitializer(void* extData, const uint8_t* ctxType, FREContext ctx, 
uint32_t* numFunctions, const FRENamedFunction** functions)
{
// setup the number of functions in this extension
*numFunctions = 3;

// create an array to store all the functions we will use.
FRENamedFunction* func = (FRENamedFunction*) 
malloc(sizeof(FRENamedFunction) * (*numFunctions));

 // create an array entry for each function
func[0].name = (const uint8_t*) getTestString;
func[0].functionData = NULL;//data type from ctxType?
func[0].function =  getTestString;

func[1].name = (const uint8_t*) isSupported;
func[1].functionData = NULL;//data type from ctxType?
func[1].function =  isSupported;

func[2].name = (const uint8_t*) getHelloWorld;
func[2].functionData = NULL;//data type from ctxType?
func[2].function =  getHelloWorld;

// create an array to store all the functions we will use.
*functions = func;
}

// A native context instance is disposed
void contextFinalizer(FREContext ctx) {
return;
}

void initializer(void** extData, FREContextInitializer* ctxInitializer, 
FREContextFinalizer* ctxFinalizer) {
*ctxInitializer = contextInitializer;
*ctxFinalizer = contextFinalizer;
}

void finalizer(void* extData) {
return;
}




[flexcoders] Re: Bug in C function caused AIR to crash

2011-12-27 Thread Tomislav
Did you try inspecting FREResut values from FREGetObjectAsUTF8 calls?

FREREsult res = FRENewObjectFromUTF8(strlen(strAll)+1, (uint8_t *)strAll, 
result);
printf(%d, res );




--- In flexcoders@yahoogroups.com, yanlilei64 yanlilei64@... wrote:

 No one know?
 
 
 --- In flexcoders@yahoogroups.com, yanlilei64 yanlilei64@ wrote:
 
  I want to pass the James string to getTestString function, the first
  time, the string could return This is James without any error.
  Subsequently after the button is click, the application will just
  hang/crash (grey out), it seem there some bugs in this code?
  
  Screenshot: http://imagetwist.com/7896zupwtu97/a.jpg.html
  
  Code:
  
  FREObject getTestString(FREContext ctx, void* funcData, uint32_t argc,
  FREObject argv[]) {
 FREObject result;
  
 //Temporary values to hold our actionscript code.
 uint32_t albumLength;
 const uint8_t *str;
 uint8_t *strAll;
  
 //Turn our actionscrpt code into native code.
 FREGetObjectAsUTF8(argv[0], albumLength, str);
 strcpy(strAll,This is );
 strcat(strAll,str);  //str is James
  
 //const char *str = this is ;
 FRENewObjectFromUTF8(strlen(strAll)+1, (uint8_t *)strAll,
  result); //UTF8 to object and return
  
 return result;
  }
 





Re: [flexcoders] Resize and Scale Window Content

2011-12-27 Thread Isabelle Loyer Perso













Re: [flexcoders] Re: Using arraycollection as text for a flex TextArea Component.

2011-12-27 Thread claudiu ursica
Either the whole entry is null or one of it's properties. Check which is null, 
and guard your code if null put empty string or whatever you seem fit for it.

C




 From: ZIONIST stinas...@yahoo.com
To: flexcoders@yahoogroups.com 
Sent: Tuesday, December 27, 2011 5:41 PM
Subject: [flexcoders] Re: Using arraycollection as text for a flex TextArea 
Component.
 

  
That works well. It actually outputs the contents of the arraycollection in the 
textarea component. One very small issue though, it outputs the word NULL 
before the last item in the arraycollection. How do i get rid of that?

Below is the update.

[Bindable]
private var orderColl:ArrayCollection=new ArrayCollection();

/*** Create an object to hold the data ***/
var obj:Object=new Object();

/*** Assign the variables to it ***/
obj.Product=product.text;
obj.Price=price.text;
obj.Qty=1;
obj.OrderNumber=label1.text;

/*** Add the object to the list ***/
orderColl.addItemAt(obj, 0);

Then i have a TextArea component (id=cart) and i try to assign the 
arraycollection to it as text like this

var txt:String;
var n:int=orderColl.length;
for (var i:int=0; i  n; i++)
{
var entry:Object=orderColl.getItemAt(i);
txt += entry.OrderNumber + , ++ entry.Product + , ++ entry.Qty 
++ Unit + ( + s + ) + , ++ $ + entry.Price ++ 
per unit + \n\n;
}
cart.text = txt;


 

[flexcoders] Find out Flex interview questions

2011-12-27 Thread php_interview_quiz
Hi Folks,

If you need any help in flex interviews,

Try this out,

http://www.flexinterviewquestions.com

Cheers !

Never far away !



[flexcoders] flex with sql server 2008

2011-12-27 Thread Nitin
hi i have a question how can i connect to the sql sever 2008 i have a little 
experience in the following subject i have just switch from the .net to flex 
and could not find the way to connect to the sql server without the use of the 
any of the server side technology like php, asp.net, java , JavaScript. is 
there a way to connect to the sql sever kindly provide with some help.

thank you,



[flexcoders] Context Menu

2011-12-27 Thread pankaj_verm...@ymail.com
Hi All,

I want to style the context menu(opening on right click option) .Is is possible 
to style it.I want to change the background color and font color .

Thanks

Pankaj