Tech n mad stuff for mads like me ;) Here i will share tech problems i came across and how i solved em !

About Me

My photo
Think a lot but do less.Life full of downs and less ups but ups are stronger than downs.

Thursday, October 29, 2009

Using open source flex sdk to compile flex apps in linux

I installed Fedora core 9 on the mission of trying to be open :)
The major challenge was how to do stuffs in linux which were in xp
Some how i installed tomcat,mysql and managed to run php apps
the next chellenge was flex !
thanks to Adobe for making flex sdk open source which allows user to compile as3 and flex
but it has its limitation
free flex sdk donot support advanced features like graphs and pie charts :(
so for simple applications and learning purpose its the best !

I downloaded latest flex sdk (version 4) from here and after a lots of google and struggle i found a simple way to compile and run flex apps.

extract the files to somewhere like your documents folder and give it a simple name(flex_sdk_4)

prepare the commands
export FLEX_SDK_HOME=/home/piyush/development/flex_sdk_4 (set this sdk home path)

and

alias mxmlc='/usr/lib/jvm/jre-1.6.0/bin/java -jar "$FLEX_SDK_HOME/lib/mxmlc.jar" +flexlib="$FLEX_SDK_HOME/frameworks" "$@"'

here /usr/lib/jvm/jre-1.6.0/bin/java is the path to java command, just find it in /usr/lib/jvm

and after you edited the paths run the above commands one by one
now we are all set to compile mxml apps :)

to check type mxmlc and if it shows following message then congrats


Loading configuration file /home/piyush/development/flex_sdk_4/frameworks/flex-config.xml
Adobe Flex Compiler (mxmlc)
Version 4.0.0 build 11120
Copyright (c) 2004-2009 Adobe Systems, Inc. All rights reserved.

Error: a target file must be specified

Use 'mxmlc -help' for information about using the command line.


be smart and go through help !!

or

to compile an mxml file give this command

mxmlc test.mxml

here text.mxml contains ur flex/mxml code !!

If u dont got java support then mxmlc will show errors ...

enjoy !!

related links :
http://asantoso.wordpress.com/2008/05/18/flex-3-sdk-command-line-development-with-example-on-linux/

Wednesday, September 2, 2009

Migrating your Flash/Flex Application From local/http server to https server

While working with a medical application I faced a lot of annoying situations. But somehow I managed to survive and completed the assigned work with good impression and lots of career defining lessons and this Https issue is one of them.

Its like this
We completed a flex application with alpha testing in a remote server using IP Adress. It was working well and our QA team gave it a green light. But suddenly client wanted to make it secure as they were planning to make a beta release of the application.

They set up a https server and when we uploaded the application it shown us an error like
"This page contains both secure and ..." Well our application is ofcourse not a spam !! and we dont distribute viruses or malwares through our page !!!

After a little google we found out its because of any http link in the application.
So we checked all the http requests and changed them to relative path i.e. placed the backend pages in child directory so that all the requests would automatically be https.
but still same dialogue!!

Then we thought there might be some server setting issue, so we kept running the application pressing "ok" button. and it worked as it was in https in firefox browser but IE started showing its color !! It simply blocked our application in the client end!!
It blocked all http requests giving us hundreds of runtime error by flash player debugger!!
So we got another more issue !!

After a long google with complete frustration i found a lifesaving post which discussed briefly about that bug in IE(even in the latest version 8).
IE says its a security feature but its actually a bug .. he he

What I simply understood is : ie keeps a quick cache whatever the server page header may be(no-cache or blank). And in https secure connections caching is like banned ! so requests with no cache header are kept in cache braking security code and blocking all such server requests with no-cache header(which is deafult).

So they suggested to use a Pragma header as blank .
php code:
header("Pragma: ");


So we included this code to all the requests and we solved the IE bug !
Now pressing "ok" in IE works well and accept result of all the requests.

But What to do with secure non-secure dialogue ??
And I found it !
I checked the html page in which the flex app was embeded got some http links
we didn't checked it as the page was auto generated by Flex Builder 3

The interesting thing in the auto generated page was this :

!--
Smart developers always View Source.

This application was built using Adobe Flex, an open source framework
for building rich Internet applications that get delivered via the
Flash Player or to desktops via Adobe AIR.

Learn more about Flex at http://flex.org
// --



hmm.. smart generators !! :)
but am i ?

So we removed all http reference in the source page but still the dialougs !! :(
I also removed ExpressInstall feature from the page but still same...

Then what i did is ran the swf directly in the browser and it worked with no error !!
so I got confident !!
Then i straight used swfObject and error gone !!
So I solved both the issues
But I am still not sure why swfobject worked ?



Thursday, August 27, 2009

simple ip tracking facility by gmail

This is a simple feature by gmail !
using this you can know which IP logged in to ur gmail account on which date.
to checkout this
scroll down to the extreme end of ur gmail home page and there you will find
"Last account activity: " and in the end there is a link for "Details"
as in the screen shot below

click on "Details" for list of some more last login details like below




Friday, May 22, 2009

Problem with setting status of gtalk to currently playing song in Windows Media Player ?

Its not that hard! So that you need me to invite to your home for a dinner to solve this ;)

While installing Gtalk , you install a plug-in for Windows Media Player(version 9+) in the background, which allows you to set the song details in Gtalk status message.


If you still couldn't solved your problem
here are the steps.

1. Go to Windows Media Player Plug-ins tab from Tools>Options...
or Tools>Plug-ins>Options...

2.There from the category list select "Background and" there you will find a plugin named "Google Talk music Plugin" if its not checked check it and you are done !
3. Do Apply>Ok and you are all set
4.Restart both Gtalk and Windows Media Player, play a song and login to Gtalk and there set your status to "Show current music track" and gtalk will give a confirmation as in the screenshot below:



if you find any problem then comment me, and dont hesitate to comment if i helped you :)

~ With Love Piyush