»
S
I
D
E
B
A
R
«
Minimum and Maximum Value of z-index
Jan 27th, 2010 by admin

The minimum value of z-index is 0, for Firefox, you can go all the way to -2147483647, but IE can’t read any value below 0.

The maximum value of z-index is 2147483647.

Setup and Develop Flex SDK 3.5 on Linux
Jan 24th, 2010 by admin

To people who can’t afford to buy Flash or Flex Builder, there is free version of Flex SDK available.

To setup and develop Flex SDK 3.5 on Linux is fairly easy.

1. Download Flex SDK 3.5
http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex3sdk

2. Extract Flex SDK 3.5 to /opt/flex_sdk_3.5

3. Add /opt/flex_sdk_3.5/bin and /opt/flex_sdk_3.5 to environment path variable

First fire up your command line tool, and execute the following command:
sudo gedit ~/.bashrc

Then add the following lines to the end of the file
export PATH=/opt/flex_sdk_3.5/bin:$PATH
export FLEX_SDK_HOME=/opt/flex_sdk_3.5

4. Create project folder in workspace, for my case, I use /home/shichuan/workspace/flex/ with project name: actionscript

The final directory structure is:
/home/shichuan/workspace/flex/actionscript/
/home/shichuan/workspace/flex/actionscript/src/
/home/shichuan/workspace/flex/actionscript/bin/

5. Copy flex-config.xml from FLEX_SDK_HOME/frameworks to /home/shichuan/workspace/flex/actionscript/flex-config.xml

cp $flex_sdk_home/frameworks/flex-config.xml /home/shichuan/workspace/flex/actionscript/flex-config.xml

6. Edit $flex_sdk_home/frameworks/flex-config.xml

gedit $flex_sdk_home/frameworks/flex-config.xml

Uncomment the source-path element, and add a path-element child in the source-path element, which points to the root src folder of our project.

/home/shichuan/workspace/flex/actionscript/src/

7. Edit /home/shichuan/workspace/flex/actionscript/flex-config.xml

change the following portion

<!-- List of SWC files or directories to compile against but to omit from -->

      <!-- linking.                                                             -->

      <external-library-path>

          <path-element>libs/player/{targetPlayerMajorVersion}/playerglobal.swc</path-element>

      </external-library-path>

      <!-- Turn on writing of generated/*.as files to disk. These files are generated by -->

      <!-- the compiler during mxml translation and are helpful with understanding and   -->

      <!-- debugging Flex applications.                                                  -->

      <keep-generated-actionscript>false</keep-generated-actionscript>

      <!-- not set -->

      <!--

      <include-libraries>

         <library>string</library>

      </include-libraries>

      -->

      <!-- List of SWC files or directories that contain SWC files. -->

      <library-path>

         <path-element>libs</path-element>   

		 <!-- keep the original location in the libpath for backwards-compatibility -->

         <path-element>libs/player</path-element>

         <path-element>libs/player/{targetPlayerMajorVersion}</path-element>    

	     <path-element>locale/{locale}</path-element>

      </library-path>

      <namespaces>

      <!-- Specify a URI to associate with a manifest of components for use as MXML -->

      <!-- elements.                                                                -->

         <namespace>

            <uri>http://www.adobe.com/2006/mxml</uri>

            <manifest>mxml-manifest.xml</manifest>

         </namespace>

      </namespaces>

to:

<!-- List of SWC files or directories to compile against but to omit from -->

      <!-- linking.                                                             -->

      <external-library-path>

          <path-element>${flexlib}/libs/player/{targetPlayerMajorVersion}/playerglobal.swc</path-element>

      </external-library-path>

      <!-- Turn on writing of generated/*.as files to disk. These files are generated by -->

      <!-- the compiler during mxml translation and are helpful with understanding and   -->

      <!-- debugging Flex applications.                                                  -->

      <keep-generated-actionscript>false</keep-generated-actionscript>

      <!-- not set -->

      <!--

      <include-libraries>

         <library>string</library>

      </include-libraries>

      -->

      <!-- List of SWC files or directories that contain SWC files. -->

      <library-path>

         <path-element>${flexlib}/libs</path-element>   

		 <!-- keep the original location in the libpath for backwards-compatibility -->

         <path-element>${flexlib}/libs/player</path-element>

         <path-element>${flexlib}/libs/player/{targetPlayerMajorVersion}</path-element>    

	     <path-element>${flexlib}/locale/{locale}</path-element>

      </library-path>

      <namespaces>

      <!-- Specify a URI to associate with a manifest of components for use as MXML -->

      <!-- elements.                                                                -->

         <namespace>

            <uri>http://www.adobe.com/2006/mxml</uri>

            <manifest>${flexlib}/mxml-manifest.xml</manifest>

         </namespace>

      </namespaces>

8. Create actionscript file: /home/shichuan/workspace/flex/actionscript/src/com/example/quickstart/Greeter.as

package com.example.quickstart
{
public class Greeter
{
public var name:String;
private var secretValue:Number;

public function Greeter(initialName:String=”Agus”)
{
name = initialName;
}

public function sayHello():String
{
var result:String;
if(name!=null && name.length>0){
result = “Hello there, “+name+”.”;
}
else{
result=”Hello there, anonymous.”;
}
return result;
}
}
}

9. Create mxml file: /home/shichuan/workspace/flex/actionscript/com/example/quickstart/Greeter_mx.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initApp();">
<mx:Script>
<![CDATA[
import com.example.quickstart.Greeter;
private function initApp():void{
var myGreeter:Greeter = new Greeter();
output.text=myGreeter.sayHello();
output.text+="\n";
myGreeter.name="Harold";
output.text += myGreeter.sayHello();
}

]]>
</mx:Script>

<mx:Text id="output" width="100%" textAlign="center"/>

</mx:Application>

9. Create a file /home/shichuan/workspace/flex/actionscript/compile

#!/bin/bash
mxmlc -load-config flex-config.xml ./src/com/example/quickstart/Greeter_mx.mxml -output ./bin/Greeter_mx.swf

10. run the compile shell script:

./compile

To test the example swf:
Open /home/shichuan/com/example/quickstart/Greeter_mx.swf in Firefox

Setting Environment Variable PATH on Ubuntu
Jan 23rd, 2010 by admin

To set environment variable path could speed up command-line development. You could add the path permanently to your system, so even after restart the system, you could still fire up the terminal and reference to the variable.

1. In your terminal, type:

sudo gedit ~/.bashrc

2. put the variable name before the equation, the path after the equation:

export FLEX_SDK_HOME=/opt/flex_sdk_3.5

Checkbox vertical alignment in HTML CSS
Jan 19th, 2010 by admin

To vertically align checkbox in HTML CSS, one has to use a combination of vertical align and margin for the checkbox.

<style>.checkbox { vertical-align:middle; margin:0px; }</style>
<input type="checkbox" class="checkbox" />
CSS cellpadding cellspacing
Jan 18th, 2010 by admin

You can set HTML table cellpadding and cellspacing in CSS.

For example, if you want table cellpadding and cellspacing to be zero, here is how you can do it:

table {
    border-collapse: collapse; // 'cellspacing' equivalent
}
table td, table th {
    padding: 0; // 'cellpadding' equivalent
}
Dreamweaver While executing onLoad in Fix
Jan 17th, 2010 by admin

One day you open Dreamweaver and suddenly see a series JavaScript error message appear like:

“While executing onLoad in tempURL_afterSave.htm, a JavaScript error occurred.”

You must have no clue what’s happening, there is nothing you need to worry, to solve this problem you have to delete FileCache.dat files from the Dreamweaver user configuration folder.

Delete the WinFileCache-7A9586CB.dat, MacFileCache-BFE7CE2E.dat, or FileCache.dat file from the Dreamweaver user configuration folder. It is recommended to delete the FileCache.dat file if you are experiencing a JavaScript error related to “dwscripts” or if you are receiving a “translators were not loaded” error message. The string of characters after “FileCache-” may differ on your machine. The location of the FileCache.dat file depends your operating system and your version of Dreamweaver. Note that on Windows, the Application Data and AppData folders are hidden by default, so verify that your Windows Explorer folder options are set to View Hidden Folders.

The sneaky evil hides in different places depends on the system you are using:

Dreamweaver CS3 on Windows Vista:
C:\Users\[username]\AppData\Roaming\Adobe\Dreamweaver 9\Configuration

Dreamweaver CS3 on Windows XP:
C:\Documents and Settings\[username]\Application Data\Adobe\Dreamweaver 9\Configuration

Dreamweaver 8 on Windows XP:
C:\Documents and Settings\[username]\Application Data\Macromedia\Dreamweaver 8\Configuration

Dreamweaver 8 on Windows Vista:
C:\Users\[username]\AppData\Roaming\Macromedia\Dreamweaver 8\Configuration

Dreamweaver CS3 on Macintosh:
Mac HD/Users/[user]/Library/Application Support/Adobe/Dreamweaver 9/

Dreamweaver 8 on Macintosh:
Mac HD/Users/[user]/Library/Application Support/Macromedia/Dreamweaver 8/

SuperScript in OpenOffice
Jan 17th, 2010 by admin

In OpenOffice, you can easily create a SuperScript in two steps.

1. Select the text you want to make into SuperScript.

2. Click CTRL+SHIFT+P on selected text will give you superscript.

Showing Horizontal Scrollbars Only in CSS
Jan 8th, 2010 by admin

By right, you shouldn’t get both horizontal and vertical scrollbars unless you make the content large enough to require them.

Howeve typically due to a bug in IE, this happens at times.

IE6-7 (amongst other browsers) supports the proposed CSS3 extension to set scrollbars independently, which you could use to suppress the vertical scrollbar:

overflow: auto;
overflow-y: hidden;

You may also need to add the following for IE8:

-ms-overflow-y: hidden;
Using CSS in Django
Jan 8th, 2010 by admin

Here is the official document that explains how to use CSS in Django: http://docs.djangoproject.com/en/dev/howto/static-files/, basically it’s about setting up your URL’s, then reference you media files in the template.

Add CSS class with JavaScript
Jan 3rd, 2010 by admin

To add instead of replacing CSS class with JavaScript is easy.

Here is how you can add a CSS class:

document.getElementById("MyElement").className += " MyClass";
»  Substance: WordPress   »  Style: Ahren Ahimsa