»
S
I
D
E
B
A
R
«
AS3 mailto
Jun 11th, 2010 by admin

To use mailto in Flash AS3 (ActionScript 3.0) like the way you use it in HTML is easy.

you can use AS3 built-in function URLRequest to create the function.

Here is an example:
navigateToUrl(new URLRequest("mailto:mail@hotmail.com"), "_self");

Flash Dynamic htmlText Bold
Jun 7th, 2010 by admin

If you use dynamic textfield in Flash and the HTML enabled text fields fail to display formatted text. There isn’t anything wrong with your ActionScript, this happens because when you embed a font, Flash does not include the entire font family automatically. Only the plain font is embedded without the bold and italic variants.

If multiple styles of the font are used in the HTML formatting, then it’s necessary to add a dynamic text field to “manage” the embedding of the entire font family.

In the Character panel, apply each style used in the movie to at least one character in the text field.
dynamic text field

AS3 Key Down Event
Jun 3rd, 2010 by admin

In AS3 (ActionScript 3), you can detect the key down event and add a function to the event. Here is an example in Flash:

package {
    import flash.display.Sprite;
    import flash.display.DisplayObject;
    import flash.events.*;

    public class KeyboardEventExample extends Sprite {
    	public function KeyboardEventExample() {
        	stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
    	}

		private function keyDownHandler(event:KeyboardEvent):void {
			trace("Key Down");
		}
	}
}
jQuery Focusing a Text Input on Page Load
Jun 2nd, 2010 by admin

If you have a login form on your form page, and you’d like the username text input field to be focused when window body onload. Use the jQuery $(selector).focus() method, you can do so with ease:

    // when the HTML DOM is ready
    $(document).ready(function(){
        // focus the <input id="username" type="text" ...>
        $('#username').focus();
    });
jQuery Disabling All Effects
May 31st, 2010 by admin

Some web users may find web page effects redundant and time-consuming, especially for returning visitors. jQuery has a way to disable all animations from one access point but still supports the animate method and its final value.

<script>
$.fx.off = true;
$(document).ready(function () {
  $('#animate').click(function () {
    $('.box').animate({ width: '+=100', height: '+=100' });
  });
});
</script>
jQuery – Scrolling an Element into View
May 30th, 2010 by admin

If you need to scroll the window to make an element into view, you can use the offset method to determine the location of the destination element relative to the document and then use the scrollTop method to scroll the document to bring the element into view.

For example, let’s say you want to scroll to the #links element when the user clicks the #related element:

jQuery('#related').click(function() {
    var fooOffset = jQuery('#links').offset(),
        destination = fooOffset.top;
    jQuery(document).scrollTop(destination);
});
Turning debugging off in IE
May 28th, 2010 by admin

The default JavaScript debugger can be irritating when it pops up error message boxes.

To turn debugging off, go to Tools->Internet Options->Advanced. Make sure that “Disable Script Debugging (other)” and “Disable Script Debugging (Internet Explorer)” are checked.

jQuery Custom Form Skin
May 25th, 2010 by admin

To build a jQuery custom form skin can be tedious, the easier way to do so is to build on an existing skin plugin. jNice is so far the easiest to use. It styles form elements like button, checkbox, select menu and input field etc. It also has cross-browser support.

You can download it at: http://plugins.jquery.com/project/jNice

Java Exit When Close Window
May 24th, 2010 by admin

You can exit an application when its close button is pressed in Java. We could register a window listener to get notification of when the user pushes the close button and take whatever action we like, but this convenience method handles the common cases.

frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

It’s called the “default” close operation because this operation, like almost every other GUI interaction, is governed by events.

Hide flvplayback control bar
May 23rd, 2010 by admin

If you use Flash IDE and flvplayback component, you might want to know how to hide flvplayback control bar. To do so is easy:

1. click on the flvplayback component instance on the stage
2. on the properties panel, under autohide option, choose true

Now if you publish the player again, the control play bar will auto hide.