Google adsense
Search
Saturday, August 18, 2012
Үргэлжлэл...
Thursday, March 24, 2011
JavaScript: check for undefined or null object/variable
//you can use foo!
}
Thanks,
InfoSource: http://snipplr.com/view/14618/javascript-check-for-undefined-or-null-objectvariable/
Wednesday, March 23, 2011
JavaScript: Enum in JavaScript
var Days = {"sunday" : 0, "monday" : 1, "tuesday" : 3, "wednesday" : 4, "thursday" : 5, "friday" : 6, "saturday" : 7};
document.write(Days.friday);
Example 2:
function Enum() {}
Enum.ColorType = {red:0, blue:1, green:2}
document.write(Enum.ColorType.blue);
Example 3:
var enumObj = new Object();
enumObj.fontSize = {small:10, medium:12, large:14}
document.write(enumObj.fontSize.small);
Thanks,
InfoSource: http://programming.top54u.com/post/Creating-Javascript-Enum-values.aspx
Friday, March 18, 2011
JavaScript: jQuery loading remote/external javascript files using getScript()
$.ajaxSetup({async: false});
$.getScript(MVCRoot+fileName+'.js');
$.ajaxSetup({async: true});FYI
Thanks,
Info Source: http://colourgray.wordpress.com/2008/09/22/jquery-loading-external-javascript-files-using-getscript/
Tuesday, March 15, 2011
JavaScript: Functions
substring() --- string.substring(from, to);
toUpperCase() --- string.toUpperCase();
toLowerCase() --- string.toLowerCase();
FYI
Wednesday, March 2, 2011
C#: Evaluate C# Code (Eval Function)
// Eval > Evaluates C# sourcelanguage
public static object Eval(string sCSCode) {
CSharpCodeProvider c = new CSharpCodeProvider();
ICodeCompiler icc = c.CreateCompiler();
CompilerParameters cp = new CompilerParameters();
cp.ReferencedAssemblies.Add("system.dll");
cp.ReferencedAssemblies.Add("system.xml.dll");
cp.ReferencedAssemblies.Add("system.data.dll");
cp.ReferencedAssemblies.Add("system.windows.forms.dll");
cp.ReferencedAssemblies.Add("system.drawing.dll");
cp.CompilerOptions = "/t:library";
cp.GenerateInMemory = true;
StringBuilder sb = new StringBuilder("");
sb.Append("using System;\n" );
sb.Append("using System.Xml;\n");
sb.Append("using System.Data;\n");
sb.Append("using System.Data.SqlClient;\n");
sb.Append("using System.Windows.Forms;\n");
sb.Append("using System.Drawing;\n");
sb.Append("namespace CSCodeEvaler{ \n");
sb.Append("public class CSCodeEvaler{ \n");
sb.Append("public object EvalCode(){\n");
sb.Append("return "+sCSCode+"; \n");
sb.Append("} \n");
sb.Append("} \n");
sb.Append("}\n");
CompilerResults cr = icc.CompileAssemblyFromSource(cp, sb.ToString());
if( cr.Errors.Count > 0 ){
MessageBox.Show("ERROR: " + cr.Errors[0].ErrorText,
"Error evaluating cs code", MessageBoxButtons.OK,
MessageBoxIcon.Error );
return null;
}
System.Reflection.Assembly a = cr.CompiledAssembly;
object o = a.CreateInstance("CSCodeEvaler.CSCodeEvaler");
Type t = o.GetType();
MethodInfo mi = t.GetMethod("EvalCode");
object s = mi.Invoke(o, null);
return s;
}
Thanks,
Info source: http://www.codeproject.com/KB/cs/evalcscode.aspx
Thursday, October 28, 2010
First step for newbie on Flash
Энэ хичээл нь зөвхөн flash эхлэн суралцагчидад зориулагдсан. Обьектонд эффект яаж оруулах вэ. Миний бодлоор flash дээр ажиллах зарчим нь эхлээд обьектоо үүсгэх > movie clip руу хөрвүүлэх > graphic руу хөрвүүлэх > тэгээд graphic дээрээ эффектээ оруулж өгөх юм. Магадгүй, энэ биш ч байж болно.
Workspace
Select the Text Tool (keyboard shortcut T) on Tools bar
Drag and Drop on the workspace
Write the text like Hello World!
Select the selectrion Tool (keyboard shortcut V) on Tools bar
Right click on the your text and click the Convert to Symbol…
Show the Convert to Symbol dialogbox. Select the Movie clip from Type then set the name that mc_helloworld. Ok click
Double click on the your text
Show it after double click.
Rigth click on the your text and click the Convert to Symbol…
Show the Convert to Symbol dialogbox. Select the Graphic from Type then set the name that gc_helloworld. Ok click
Select the first keyframe of Layer 1 on Timeline bar. Then press the F5 on keyboard to frame 15.
Rigth click on frame 15 and click the Insert Keyframe.
Click the frame 1 and select the your text. Then show the object properties dialogbox (click the Properties on bottom or from Window menu)
Select the Alpha of Color property and set the 0 (zero).
Select the frame 15 select the your text. Then show the object properties dialogbox (click the Properties on bottom or from Window menu)
Select the Alpha of Color property and set the 100.
Rigth click the frame 1 and click Create Motion Tween.
Rigth click the frame 15 and click Actions.
Write the stop();
Now, Run the movie. Select the Control > Test Movie (keyboard shortcut Ctrl+Enter).
You're done. Good Luck! :)
Thanks,