Tuesday 29 March 2011

flex, how to print from flash / flex application...

problem:
Print is important from some applications, for any kind of receipt. Imagine that you may use resources from internet server to issue a doc at client's terminal where has nothing except a printer... i.e. tickets!

solution:
Flex supports a very easy way to print... just create a Group container (or a display container in general) and pass in addPage method...
The follow example prints itself (as I pass the this as argument to addPage method).

            internal function print():void{
                var printJob:PrintJob = new PrintJob();
                if (printJob.start()){      //this open's the dialog
                    printJob.start();       //if user choose 'print' then... start
                    printJob.addPage(this);
                    printJob.send();
                }
            }


Read the help about the PrintJob object where is not complex and it is tiny.

disadvantages:
The user has to press the print button in the system's print dialog box.
You cannot adjust the page size.

Wednesday 23 March 2011

total commander settings files | configuration files

situation:
total commander is maybe the best file managet even created in windows. supports great ftp client... in any case is not so user friendly but for professionals is a professional tool. I suggest you buy it and help this such as great software house. 

problem:
what is happening when we want to transfer it to another computer and get our personal settings and ftp accounts also?

solution:
just transfer the follow two files in windows directory again

c:\windows\wcx_ftp.ini
c:\windows\WINCMD.INI
the first is for ftp connection and the other for the rest settings

adobe flex how to pass parameters arguments from html to swf flex / flash application

problem:

how to inform an swf with some arguments / parameters with values

solution:

the solution is similar how you call an php code

Passing arguments from URL query (http://www.mycompany.com....)
http://www.mycompany.com/movie.swf?firstVar=101ps

Passing arguments from HTML code
Assuming the image filename is image1.jpg, located at a folder named images.  And assuming that the Flash movie will use a variable named imageFilename to refer to the file, then we can do this:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  codebase="http://download.macromedia.com/"  
  WIDTH="250" HEIGHT="300" id="flaMovie1">
  <PARAM NAME=movie VALUE="flaMovie1.swf?imageFilename=images%2Fimage1%2Ejpg">
  <PARAM NAME=quality VALUE=high>
  <PARAM NAME=bgcolor VALUE=#FFFFFF>
  <EMBED src="flaMovie1.swf?imageFilename=images%2Fimage1%2Ejpg"
    quality=high bgcolor=#FFFFFF WIDTH="250" HEIGHT="250" NAME="flaMovie1"
    TYPE="application/x-shockwave-flash"
    PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
  </EMBED>
</OBJECT>


There you see that I appended a query string after the Flash movie filename (flaMovie1.swf).  The query string contains one variable: imageFilename, with the value of images/image1.jpg.  
Note: The %2F is the url encoding for the "/" sign, and %2E is the url encoding for the "." sign.  Since these symbols are unsafe or reserved, we should url encode them, although at the present Flash does not seem to care.  So saying: imageFilename=images%2Fimage1%2Ejpg is essentially the same as saying imageFilename=images/image1.jpg (see: Introduction to URL Encoding)

Reading arguments in Flex from HTML
root.loaderInfo.parameters.firstVar
root.loaderInfo.parameters.ImageFilename
The "parameters" is an array with the arguments. The "firstVar" in Flex code is not a known variable but it is supported from Array or Flex.

Friday 18 March 2011

did you lost again your nod32 license key?



problem: did you lost again you nod32 license key?


solution: use this one:
Username: EAV-41924443
Password: 7bu62epjj3
valid: till 18/3/2012

Wednesday 16 March 2011

how to hide (for some reason) an application(s) from your computer

problem:
in some cases you have to hide an application from your computer...
In the follow step you will learn how to hide an application from start up menu, from "add / remove" / "programs" list. Of course the application will be accessible and fully functional. In any case this way of hide will have result to hide an application from simple users and not from technicians... but is a good way to hide an application.

difficulty: 7/10 (expert users)

compatibility: winxp, win vista, win7


let's work...

Flex4, Flex3, how to load an html to TextArea with htmlText property

problem: 
not something important... how to load a simple html file... or a plain text file

solution:
In this example I will create the "l" object where is a URLLoader.
The TextArea object is the "ta_plateu" object where is at "main" module on design time.
I have placed the htmlText: "Loading... please wait..."; this text will be appeared to the user till the download is completed and with this text I can discriminate if I have downloaded or not the text. (Of course this is not the perfect discrimination way, and it doesn't work well if the loaded text contains the "Loading..." text also).
use the follow code... accordingly:somewhere in your code you have to request the file...
      if (main.ta_plateu.htmlText.search("Loading...")>-1) {
        var l:URLLoader = new URLLoader;l.dataFormat=URLLoaderDataFormat.BINARY;
        l.load(new URLRequest("http://www.mycompany.com/docs/plateu_ital_text.html"));
        l.addEventListener(Event.COMPLETE,Plateu_download_completed);
      }
now you have to implement the listener "Plateu_download_completed" where will be triggered when the download is completed:
    public function Plateu_download_completed(event:Event):void{
      main.ta_plateu.htmlText=URLLoader(event.target).data;
    }

notes:
On this example are not checked the error conditions... you have to implement and the other events like I have done Event.COMPLETE.
Also the "l" object is not global in the class. Multiple call of the 1st block where you do the download request will have no so good performance. Its better to define the "l" object in the class (not in a function of your class) and remove the event listener in the "Plateu_download_completed" function.

Friday 11 March 2011

windows keys

win xp pro eng sp2: DB4H8-DQJJB-KXMWP-GPJVY-H7P6W

I lost ms office enterprise 2007 keys :(

problem with your purchased keys?

solution:

MS office 2007 Enterprise English

I've released the source to my launcher which was written in AutoHotKey v.1.0.46.10.
If you have any problems with the launcher application or find any bugs e-mail me at pw88@icmail.net
It took a very long time for me to make thought, there where many bugs, but I think I've eliminated them now XD.
Serials are auto inserted by the launchers, but if you have any problems...

Microsoft Office Enterprise 2007:
F3DJD-6FFQ4-XQTQF-PGK47-8MDQ8

Microsoft Office Visio\Project Professional 2007:
HCFPT-K86VV-DCKH3-87CCR-FM6HW

Microsoft Expression Web:
DDWJC-VFGHJ-7GFK6-9QK3D-PFTHW

LICENCE:
The code has been released for anyone to edit (or learn from!), you may use it freely except copying it and placing under a different developer name or claiming to have made the launcher.
I do not take any responability for any strange effects or problems cause by any of the software on this CD (or image).
Any issues with Microsoft Office are to be taken up with Microsoft Corporation.
Any issues with the launcher you'll just have to live with or fix them if you write AHK.

Ms office 2007 Enterprise Greek

KGFVY-7733B-8WCK9-KTG64-BC7D8

escape characters to cut paper

situation:
this solution if for 80mm printers, also known as kitchen printers or receipt printers.
EPSON PRINTER (pcl)


problem:
how to cut the paper or open the drawer

solution:

escape characters to cut paper +#27+#100+#08+#27+#105 +#27+#07;
open drawer 1 +#27+#112+#0+#96+#255;
open drawer 2: +#27+#112+#1+#96+#255;

Wednesday 9 March 2011

how to install generic printer in windows embedded?

situation:
windows embedded pos ready 2009; v2.0 with sp3... pretty poor...


problem:
Microsoft is micro-soft and many things are not so easy to be done... so... how to install a generic printer as the driver that is installed inside the system initially... it is someway incompatible?!?
By the same way as described bellow, you may add any other printer from windows setup cd... some of them are very useful and full compatible with huge range of printers, some of them are:
- IBM proprinter II (for old pcl 1-5 protocol dot matric printers)
- Hp LaserJet 4p (this supports almost all graphic printers!)
- Lexmark Optra Plus (useful in order to get print image!)

solution:
note: you will need a windows xp setup cd... (in precise the \i386 directory of it)
lets start...
01. go to Control Panel
02. press to "Add hardware", then press next to the welcome message of the wizard
03. let it search... :(
04. select "yes, I have already connected the hardware" and press next
05. go to at the end of the list, select "add a new hardware device" and press next
06. select "install the hardware that I manually select from a list (advanced)" and press next
07. from the list select "Printers" and press next
08. select a port, or create a port, or what ever you want and press next
09. here press the button "have disk"
10 Here you must define at "copy manufacture files form:" the "d:\i386" where d is the drive if the the cd drive with windows xp setup cd, or define where you have store the \i386 files from the windows xp setup cd.
11. From Manufacture list select "Generic" and from Printers "Generic / text only" and press next
12. To be sure, select always "replace existing driver" at least once, press next
13. give it a proper and distinctive name and press next
14. in the follow steps of the wizard, select as you want and press next... and finally press the "Finish" when appeared
15. Now, normally, after the press of the Finish button, the wizard will ask you the windows setup disk.... press Ok and navigate it to "d:\i386" where d is the drive if the the cd drive with windows xp setup cd, or define where you have store the \i386 files from the windows xp setup cd; press ok to contitnue
16. the wizard closes and the printer should be created!


ALSO... you may download the cd of windows embedded from here.

how to change the location of "my documents" "desktop" "application data" and so on places...

problem:
the local disk c: is full of documents, movies and so on... you bought a second huge disk but you do not know how to transfer them.

Solution1 (not recommended):
A rough solution is to change the folders where the system uses for "desktop" and "my documents". Personally I don't recommend you this solution but the solution2. The reason is that even Windows and other Applications are not fully compatible with windows... :) as they store and try to find files at locations where will be no exist anymore. If anyway you want to do this I will allow you to shoot your leg.

How to change from windows registry, the location of "my documents" "desktop" "application data" and so on places?

go to this key and change respectively
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
read more about this at microsoft's site
 
...further away... I allow you to shoot your head...

How may I change the User Profile Folder?

- Logon to an admin account that is not the account being renamed.
- Open the Documents and Settings folder, by typing this in Start, Run dialog:
        %systemdrive%\Documents and Settings
- The list of folders will be displayed. Select the corresponding folder of the user account that you want to rename or move it other disk.
- open the registry and go to the follow key:
    HKEY_LOCAL_MACHINE \ SOFTWARE\ Microsoft\ Windows NT \ CurrentVersion \ ProfileList
- find the proper sub key... and change the ProfileImagePath key

read more about this at microsoft's site
Note that is not recomended even from Microsoft!
good luck

Solution2 (recommended):

Create a directory to your new disk... i.e.: f:\store.
Create shortcuts in "desktop" "my documents".
Move your files via these shortcuts.
In future store your files these shortcuts.
Change also the .pst files location of msoffice to a place via these shortcuts.
By this way, you may format you system disks without having to find and transfer so many files.