Archive for category Flex_Hack

Center tag: keep everything in middle

<html>

<body>

<center>

… put any content, it will be aligned in the center of browser page
… I think we have to keep content size lesser than browser size
to fit into middle
</center>

</body>

</html>

 

 

 

Advertisements

Leave a comment

Flex : Find the URL of the Server / Local file location based on the Application server type

This code is used to find the URL of the Server / Local file location based on the Application server type (java, php,.. / none).

– by Abdul

Leave a comment

Alert control with long text in single line

alert = Alert.show(“Terms and Conditions Agreement”,”,Alert.YES | Alert.NO,this,function(){},null,Alert.YES);

alert.mx_internal::alertForm.mx_internal::textField.mouseEnabled = false;

alert.mx_internal::alertForm.mx_internal::textField.htmlText = “asdjflasdjfklasjdlfkjasdklfjal5rt34523452345234asdjflasdjfklasjdlfkjasdklfjal5rt34523452345234asdjflasdjfklasjdlfkjasdklfjal5rt34523452345234asdjflasdjfklasjdlfkjasdklfjal5rt34523452345234asdjflasdjfklasjdlfkjasdklfjal5rt34523452345234”;

alert.mx_internal::alertForm.mx_internal::textField.autoSize = TextFieldAutoSize.CENTER  ;

alert.mx_internal::alertForm.mx_internal::textField.wordWrap = false ;

1 Comment

Cannot debug this SWF because it does not contain ActionScript

Dhiraj Said :

In my project I was facing a problem in Flash. In which it seems that the code was not executing, I can’t even trace anything written in constructor of my document class, And when I had tried to debug the same I got the alert message saying
“You cannot debug this SWF because it does not contain ActionScript.”.

I have found a solution for this

Problem:
“You cannot debug this SWF because it does not contain ActionScript”.
Unable to compile the source code.

Solution:
This was due to the large size of the source code. The document class consists about more than 16 thousand line.
Because of this the compiler was unable to compile the code.

Here all we have to do is increase the heap memory size of JVM used by flash to compile SWFs.

Here is the way:
Go to
My Computer > Advance system setting >  Environment variable

In the system variable

1. Add  JAVA_TOOL_OPTIONS and its value as –Xmx512M

Here are the other value (–Xmx128M, –Xmx256M, etc)

Do not set to  –Xmx1024M or that will again cause another error of JRE.

2. File >> Save and Compact
3. Delete ASO file from control menu
4. Close Flash,
5. Open Flash.

This solved my problem… ?

Reference Link: http://www.negush.net/blog/5005-unknown-error-optimizing-byte-code/

1 Comment

Flex Builder Key Assist

Use following key shortcuts, as they help in faster code development
1) select the code line or lines, then Ctrl + Alt + Up Arrow Key or Ctrl + Alt + Down Arrow Key
— copy the selected line or lines of code on upside/downside of the selected line or lines

2) Ctrl + O
— opens the window with all variables , functions and controls in current .mxml or .as file

3) Ctrl + Shift +R
— opens the window with list of all files of all open projects in the workspace of Flex builder
— very useful if you remember the filename of the file which  you want to open.

4) Ctrl + Shift +F
— opens the search window and search throught files of all open projects in the workspace of Flex builder

Enjoy great coding of Flex !!I will post some more in future. You can also find key assist in Flex builder by Ctrl+Shift+L.

Leave a comment

Alert Box customization

1) Prevent scroll of alert message in case of more text

import mx.controls.Alert;
use namespace mx_internal;
private var alert:Alert;

private function preventAlertContentScroll():void
{
alert = Alert.show(‘Long alert message causing scroll in text on mousewheel and I want to prevent that. ‘);
alert.mx_internal::alertForm.mx_internal::textField.mouseEnabled = false;
}

2) Styling of Alert Text

In Style Tag , define class based style and for specific style to the text content use messageStyleName.

– Alert
{
messageStyleName: “alertMessage”;
}

.alertMessage
{
letterSpacing: 0;
fontSize: 10;
fontWeight: normal;
color: black;
}

There are some more styles related to the Alert control.

Leave a comment

Create Adobe AIR project with .as file as main application

– check out the site to know how we can remove the default mainapplication.mxml and use mainapplication.as in Adobe AIR project

Leave a comment