Hi, I was trying to make the Main Application open and dock from a child window, here is the simple code to do this, it check if the Main application is not docked, if not if put that to front.
if(FlexGlobals.topLevelApplication.stage.nativeWindow.visible == false)
{
FlexGlobals.topLevelApplication.stage.nativeWindow.visible = true;
FlexGlobals.topLevelApplication.stage.nativeWindow.orderToFront();
}
FlexGlobals.topLevelApplication.stage.nativeWindow.orderToFront();
-Varun Rathore
Wednesday, May 25, 2011
Tuesday, May 17, 2011
Increasing Java Heap Size - Posting Bigger Files in Apache SOLR
In some cases we need to post bigger xml file in SOLR server for indexing, if you post the file directly you get OutOfMemoryExceptions to avoid such failure, we need to change the max memory size that the heap can reach for the JVM
Here is the Command by which we can increase the heap size
java -Xms128m -Xmx8192m - jar
So in order to post bigger files now we use
java -Xms128m -Xmx8192m - jar post.jar <*.xml>
The -Xmx argument defines the max memory size that the heap can reach for JVM.
The -Xms argument sets the initial heap memory size for the JVM.
-Varun Rathore
Here is the Command by which we can increase the heap size
java -Xms128m -Xmx8192m - jar
So in order to post bigger files now we use
java -Xms128m -Xmx8192m - jar post.jar <*.xml>
The -Xmx argument defines the max memory size that the heap can reach for JVM.
The -Xms argument sets the initial heap memory size for the JVM.
-Varun Rathore
Apache SOLR , Deleting-Removing all data at one Go
If we need to remove/delete the indexed data from SOLR server here is a simple one line command which does the magic for you.
java -Ddata=args -jar post.jar "<delete><query>*:*</query></delete>"
-Varun Rathore
java -Ddata=args -jar post.jar "<delete><query>*:*</query></delete>"
-Varun Rathore
Monday, November 30, 2009
Free Education To Freshers and Project Training

As the RIA worker i am starting on providing free education to college students and freshers on Flex/AIR and java development to prepare them for Interview and to open there mind on a rich development practices .. This will be a experimental step to educate newbies , I will be covering the basic application development methodologies and will help them create applications for their projects.
Please feel free to contact me at
Varun Rathore
+919988178054
vrathore84@gmail.com
Sunday, November 29, 2009
A Great Window Utility - Windows 7 TuneUp

Windows 7 TuneUp is a great Window utility which makes you forget about PC maintenance and security, Loaded with many tools such as Registry Cleaner,Registry Defragmenter,Junk Files Cleaner, Duplicate Files Finder,Smart Uninstaller,Service Manager,Startup Manager and many more which help you get rid of all the maintenance problems for the system. I recomend this personally as it saved my sysytem from getting crashed and help me save my formatting time.
One of the coolest thing is its very easy installation and free support and service.
Check out this amazing software at WINDOW 7 TuneUp
Tuesday, October 27, 2009
Invoking AIR Application using Batch File

I am pretty sure if we are using a application which interacts with other application we need to invoke it using command propmt . Here is a simple way to invoke the application ..Also while invoking sometime we need to pass variables to the application as we do in flash vars..
First of all we need to set the environment variable for accessing the flex sdk in the system.. Add the following path to the sysytem path variable in your environment variable
C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\bin
Note : It should point to the sdk's bin location in mycase it resided in C:/ Drive .
To Run the application we will use ADL(AIR Debug Launcher) using the following syntax:-
adl [-runtime runtime-directory] [-pubid publisher-id] [-nodebug] application.xml [root-directory] [-- arguments]
In my case i used the following line on my command prompt
F:\PROJECTS\Printing\bin>adl Printing-app.xml -- 321 0 active
First i reach to the point where my application bin folder reside(having compiled swf and application descriptor file) then using adl to invoke my application-app.xml
Note:-
After the application-app.xml i added -- and then i gave three arguments separated my space.
In the application i can get the aruments as follows :-
We listen the following function in the application invoke="onInvoke(event)"
private function onInvoke(e:InvokeEvent):void
{
var arguments : ArrayCollection = new ArrayCollection( e.arguments );
}
Here i get all the arguments in a arraycollection.
Labels:
ADL AIR,
ADL Flex,
Batch File,
Command Prompt,
Invoking AIR,
Run AIR
Sunday, October 11, 2009
Reading and Writing Browser Cookie in Flex

A browser cookie is a small piece of information sent by a web server to a web browser to be stored for future use. The data in the browser cookie will be sent back to the web server whenever the browser reconnects to the web site.
Cookies are commonly used to store user preference information, such as web site options. Cookies are also used to store shopping cart contents. The most security-relevant use of browser cookies is when they are used to store authentication data, such as user names and passwords.
To Read and write Cookie from a flex application we will use Javascript
//Following function will set the cookie in the user browser
function setCookie(c_name,value,expiredays)
{
value = document.getElementById('user').value;
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString());
}
//Following function will return Cookie
function getCookie(c_name){
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1)
{
c_start=c_start + c_name.length+1 ;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}
For reading a cookie Visitor we will use the following line in Flex code:-
var visitorId : String = ExternalInterface.call("getCookie","Visitor");
Cheers
Varun
Wednesday, August 26, 2009
Flex Challenge to know your acquisitions
Here is a good go-ahead step by Adobe india for flex developer to know their skills
Check out the great application with a great challenge at
http://flashahead.adobe.com/challenges/
I finised the challange in less than 20 minutes. :)
Cheers
Varun Rathore
http://www.vrathore.blogspot.com
Using ShareThis in Flex-Flash

Wondering when ShareThis would actually provide a .swf file to be loaded in the fash file in stead of calling a JavaScript function to open the ShareThispop in the new window.
First of all we need to go to sharethis.com publisher section and customize your widget, you will get a javascript code by registering your email address. Here is javascript code what i got :-
script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=9f363e20-dc32-444d-a8c9-afd21615fd57&type=website&popup=true&embeds=true">
// ACTIONSCRIPT CODE
private function shareThis():void
{
var url:String = "http://www.vrathore.blogspot.com";
var title:String = "VARUN-RATHORE";
ExternalInterface.call("ShareThis", url, title);
}
Using a javascript code in the html file for opening the pop window
// JAVASCRIPT CODE
function ShareThis(url, title)
{
url = window.location;
var s = SHARETHIS.addEntry({
url: url,
title: title
}, {button:false,popup:true});
s.popup()
return false;
}
Cheers
Varun Rathore
Subscribe to:
Posts (Atom)
About Me
- vrathore
- noida, dehli, India
