Online computer courses, code, programming tutorial and sidebar information for monitoring Canadian S&P/TSX index. Build friendship and networking. Welcome to visit my blogs often!!! I also have two other sites: YouTube Channel and Google site.
Adsense
Popular Posts
- PHPWind-- A PHP forum script applcaition in China
- PHP: add a download as pdf file button in report page
- How to blend adsense inside your post?
- Formatting my post
- Notepad++ - Add C++ compiler
- PHP connect IBM db2 database in XAMPP
- Datatable export excel wraptext and newline
- phpexcel toggle expand and hide column in EXCEL and summary
- Sweet Alert JS library - beautiful replacement of JavaScript Alert
- Set up a child account and set screen time limit in Windows 8
Saturday, November 26, 2011
PHP content management systems using subMerged
subMerged is a theme or template for various content management systems.
Detail can be found:
http://submerged.sourceforge.net/
There are subMerged for phpBB3, Coppermine Photo gallery, phpWebSite, and phpNuke
Below is the demo for Coppermine Photo gallery.
Friday, November 25, 2011
JavaScript, set focus on document.form
Purpose: when the web page is loaded, set the focus on the subject of the form,
i.e. the input field of the subject in the form is blinking and ready to accept the text input.
<form name="testform"> <input type="text" name="subject"> </form>
Modify the body tag to:
<body OnLoad="document.testform.subject.focus();">
Tuesday, November 22, 2011
Online vector graphics editor - SVG editor
You can download SVG-editor for free from
http://code.google.com/p/svg-edit/
You just need to copy the download folder to your web server and run svg-editor.html.
You can have free-hand drawing, lines, polylines, ellipses, square and much more features online.
One of the website used SVG editor for clipart is: http://www.clker.com/
I do find a lot of nice drawings there using SVG editor.
SVG editor demo can be found below as embed:
Monday, November 21, 2011
Flash CS5 actionscript editor and Code Snippets
This video tutorial from Adobe TV shows how to use custom class code hint and completion in Flash CS5 ActionScript editor.
You may not remember all the ActionScript libraries and functions. The video below from Adobe TV show you how to use and modify existing snippets to quickly add functionality to your project, as well as creating and saving your own snippets for later use.
Show quoted text and hide quoted text in JavaScript
In GMail, we can see "show quoted text" and "hide quoted text"
in the mail body. We can apply the same functionality in blog posts
use JavaScript.
1) First, we need to define two CSS classes: hidden and displayed
<style type="text/css">
.hidden { display: none; }
.displayed { display: block; }
</style>
2) Second, we need to define a Javascript function display to toggle
between hide and display
<script type="text/javascript">
function display(divID) {
var item = document.getElementById(divID);
if (item) {
document.getElementById('toggletext').innerHTML =(item.className=='hidden')?'Hide quoted text':'Show quoted text';
item.className=(item.className=='hidden')?'displayed':'hidden';
}
}
</script>
3) Create a hide and display link
<a id='toggletext' href="javascript:display('testcode');">Show quoted text</a>
<div id="testcode" class="hidden">
<h3>Welcome to Jiansen Lu blogs</h3>
</div>
Result (click to see the hidden text)
Show quoted text
Welcome to Jiansen Lu blogs
Thursday, November 17, 2011
ActionScript 3.0: produce an online voice recorder in flash
Following the instruction on active tuts website:
http://active.tutsplus.com/tutorials/actionscript/create-a-useful-audio-recorder-app-in-actionscript-3/
I designed an online voice recorder as below. The design used the MicRecorder class from google code library. When you click the button, the sound around is recorded by your microphone. When you click stop, the sound is saved in your local computer.
Another good flash tutorial can be found:
http://www.webzo.org/tutorials/flash.php?page=1
Result of my sound recorder.
Wednesday, November 16, 2011
Difference between Actionscript 3.0 and ActionScript 2.0 video tutorial
This one hour video tutorial from Adobe TV is presented by renowned Flash developer R Blank. He explains the basics of getting things done in ActionScript 3.0 and the difference between ActionScript 3.0 and ActionScript 2.0.
Actionscript 3.0 design a flash loader using progress bar and UILoader
Purpose: To design a container to load external flash and show loading progress bar
1. Open flash CS5, new ActionScript 3.0 flash document
2. Set document Class as "Loader" in the Properties panel.
3. Drag the ProgressBar component and UILoader component from the Components panel to the library.
4. Save this files as Loader.fla.
5. In the same folder of Loader.fla, enter following ActionScript 3.0 in Loader.as:
package
{
import flash.display.MovieClip;
import flash.display.Sprite;
import fl.containers.UILoader;
import fl.controls.Label;
import fl.controls.ProgressBar
import fl.controls.ProgressBarMode;
import flash.events.*;
import flash.text.*;
//For Security.allowDomain
import flash.external.ExternalInterface;
import flash.system.Security;
public class Loader extends Sprite
{
private var UI_intro_loader:UILoader;
private var progressText:TextField;
private var bar_pb:ProgressBar;
private var introURL:String = 'http://www3.telus.net/jianlu58/resizebutton.swf';
public function Loader()
{
init();
}
private function init():void
{
//Load the Room Builder
var now:Date = new Date();
var queryString = this.loaderInfo.parameters;
var domain = "http://www3.telus.net/";
// allow domain www3.telus.net to access this flash
Security.allowDomain(domain);
UI_intro_loader = new UILoader();
UI_intro_loader.autoLoad = false;
UI_intro_loader.source = introURL;
UI_intro_loader.scaleContent = false;
UI_intro_loader.load();
bar_pb = new ProgressBar();
bar_pb.mode = ProgressBarMode.EVENT;
bar_pb.source = UI_intro_loader;
bar_pb.move(stage.stageWidth / 2 - bar_pb.width / 2, stage.stageHeight / 2);
bar_pb.addEventListener(ProgressEvent.PROGRESS, onProgress);
bar_pb.addEventListener(Event.COMPLETE, onComplete);
addChildAt(bar_pb,0);
progressText = new TextField();
progressText.x = bar_pb.x;
progressText.y = bar_pb.y + bar_pb.height;
progressText.textColor = 0xffffff;
progressText.autoSize = TextFieldAutoSize.LEFT;
addChildAt(progressText, 1);
//trace(UI_loader.source);
}
private function onProgress(e:ProgressEvent):void
{
//trace(e);
progressText.text = int(e.currentTarget.percentComplete) + '%';
}
private function onComplete(e:Event):void
{
//trace(e);
addChildAt(UI_intro_loader, 1);
var intro:MovieClip = UI_intro_loader.content as MovieClip;
intro.play();
//remove progress bar when it is done!
bar_pb.removeEventListener(ProgressEvent.PROGRESS, onProgress);
bar_pb.removeEventListener(Event.COMPLETE, onComplete);
removeChild(bar_pb);
removeChild(progressText);
}
}
}
6. Result:7. Reference:
A.Use the ProgressBar component
http://help.adobe.com/en_US/as3/components/WS5b3ccc516d4fbf351e63e3d118a9c65b32-7fa4.html
B.Customize the ProgressBar component
http://help.adobe.com/en_US/as3/components/WS5b3ccc516d4fbf351e63e3d118a9c65b32-7f43.html
Wednesday, November 9, 2011
ActionScript 3.0: play and play again buttons
To design a game in flash using ActionScript 3.0, click play button to start a game. After the game over, click "Play Again" button to restart the game.
1) Start Flash CS5, click new-> actionscript 3.0, name your fla fileas myGame.fla, set class: myGame in property menu.
2) Create 3 frames, the first frame name: "start", second frame name: "play", the third frame name: "gameover"
3) In "start" frame, create a button instance name: startButton
Press F9, enter following actionscript:
//stop at first frame
stop();
//When mouse click startButton, call function clickStart
startButton.addEventListener(MouseEvent.CLICK,clickStart);
function clickStart(event:MouseEvent) {
//go to "play" frame
gotoAndStop("play");
}
4) In "play" frame, create your game. for example, you can create a MovieClip and you can call a function from myGame.as actionscript file.5) In "gameover" frame, create a button called "playAgainButton". Press F9 to enter following actionscript:
//When mouse click "playAgainButton" button, call clickPlayAgain function
playAgainButton.addEventListener(MouseEvent.CLICK,clickPlayAgain);
function clickPlayAgain(event:MouseEvent) {
//go to "play" frame
gotoAndStop("play");
}
Friday, November 4, 2011
The RSA Animate series of video clips
The RSA Animate series of video clips used animation to present some very sophisticated ideas to learners. You can find all RSA animate video series here:
http://comment.rsablogs.org.uk/videos/
Example video: RSA Animate - Smile or Die
Acclaimed journalist, author and political activist Barbara Ehrenreich explores the darker side of positive thinking.
Maximum number of MySQL connection
Use MySQL query browser to check maximum number of MySQL connection:
1) Click Tools at the top manual
2) Select MySQL Administrator
3) Click Start Variables at the left Panel
4) Click "Advanced Networking", under Advanced, you can change Max connection, the default for old MySQL database is 100, for MySQL 5.5 is 151.
Some flash code and ActioScript Resources
Flash Game University is the companion site for the book ActionScript 3.0 game programming university. You can finsh video tutorials for flash game design from Flash Game University on:
http://flashgameu.com/list_all_posts.html
The source code can be downloaded from:
http://flashgameu.com/book_source_files_2.html
There are alos some great articles from http://www.learningactionscript3.com/
For how to compile ActionScript, you can find it from:
http://edutechwiki.unige.ch/en/AS3_Compiling_a_program
There are also some detail explanation of ActionScript:
http://edutechwiki.unige.ch/en/AS3_example_Positioning
Wednesday, November 2, 2011
Clear file history in Acrobat Reader, Word document and Firefox
In Acrobat Reader:
1) Click Edit in the top menu
2) Select Preferences
3) Click Documents (the first row)
4) Right side under open setting, change the "Documents in recently used list" to 1. You can select from 1 to 10.
In Word document:
- Click the File tab
- Click Recent, you can see a list of your recent files
- Right click the file you want to remove from the list and select Remove from the list
1) Click Firefox tab and click options
2) Click options
3) Click Privacy tab,
4) Click clear your recent history
Tuesday, November 1, 2011
PHP, compress and extract files using PclZip library
PclZip library offers PHP compression and extraction functions for Zip formatted archives. PclZip library can be downloaded from:
http://old.phpconcept.net/pclzip/index.en.php
The user menu can be found HERE.
To include pclzip library:
include_once('pclzip.lib.php');
To add or extract very large file, "memory_limit" value in php.ini needs to be increased. "memory_limit" can also set in the PHP code:
ini_set('memory_limit', '180M');
To initialize a zip instance:
$myzipfile = new PclZip('myzfile.zip');
To create a zip file from image1.jpg and image2.jpg:
$mylist = $archive->create('mydata/image1.jpg,mydata/image2.jpg',
PCLZIP_OPT_REMOVE_PATH, 'data',
PCLZIP_OPT_ADD_TEMP_FILE_ON);
Subscribe to:
Posts (Atom)