Thursday, September 6, 2007
ActionScript and Flash
Tuesday, June 26, 2007
Animations in JavaScript
There are two methods of interest here: setInterval () and clearInterval().
Presumably, we would need to play the frames of a sequence in a loop. We would call
setInterval() like this:
var Interval = setInterval ("MultiSelect()", 500);
By saving a reference to the current interval, we can pause the animation with clearInterval().
clearInterval (Interval);
Refer your friends to this blog:
http://programmingcentral.blogspot.com
Friday, June 8, 2007
Help Authoring suite
Are there any suites that provide descent features with a descent price?
Refer your friends to this blog:
http://programingcentral.blogspot.com/
.NET UI Suite
There are some many cool things about this suite. I don't know where to start. Most impressive is their implementation of the Office 2007 interface. Not only is it faithful to the appearance and implementation details of the ribbon, the performance is superb. This product will definitely add years to your peace of mind.
Check it out at http://www.devexpress.com/
Refer your friends to this blog:
http://programmingcentral.blogspot.com/
Tuesday, June 5, 2007
An excellent JavaScript tree
I think this is the best solution I've seen so far.
http://www.destroydrop.com/javascripts/tree/
Refer your friends to this blog:
http://programmingcentral.blogspot.com/
Friday, June 1, 2007
Pass variables by reference in ASP
Remember that incoherent explanation regarding "stacks" and "heaps"? Well, neither do I.
I had to figure it out on my own. I imagine it this way. Let's assume we're going to a department store. When we enter, we check in our bags. The kind person at the counter then hands us a ticket number corresponding to the compartment where our bags are placed. The ticket is a "reference" to our bags and the square compartment can be likened to "memory".
If we were to lose our "reference" to our bags, i.e., lose our ticket, the kind person at the counter, overcome by a sense of glee, would keep our bags for himself.
When we return the ticket, the kind person at the counter looks for a compartment that matches the label on the ticket and returns our bags (Hopefully with everything still in it)
In any event, here's my solution:
<%
Dim var1, var2
MyRoutine var1, var2
Response.Write ("Values are : " & var1 & " and " & var2)
%>
<%
Sub MyRoutine(v1, v2)
v1 = "Variable 1"
v2 = "Variable 2"
End Sub
%>
Refer your friends to this blog:
http://programmingcentral.blogspot.com/
Thursday, May 31, 2007
How to prevent right-click with JavaScript
<script language="javascript">
var isNS = (navigator.appName == "Netscape") ? 1 : 0;
if(navigator.appName == "Netscape")
document.captureEvents(Event.MOUSEDOWNEvent.MOUSEUP);
function mischandler( )
{ return false; }
function mousehandler(e)
{
var myevent = (isNS) ? e : event;
var eventbutton = (isNS) ? myevent.which : myevent.button;
if((eventbutton==2)(eventbutton==3))
return false;
}
document.oncontextmenu = mischandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
</script>
Refer your friends to this blog:
http://programmingcentral.blogspot.com/
Prevent browser F5 refresh
This solution works with Internet Explorer. Simply place this code in the "head" section of your page.
<script language=javascript>
document.onkeydown = function(){
if(window.event && window.event.keyCode == 116)
{ // Capture and remap F5
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 505)
{ // New action for F5
return false;
// Must return false or the browser will refresh anyway
}
}
</script>Refer your friends to this blog:
http://programmingcentral.blogspot.com/
Wednesday, May 30, 2007
How to loop through HTML Forms collection and validate control values
for (j=0; j<document.theform.elements.length; j++)
if ( document.theForm.elements[j].type == "text" )
{
//Perform validation when the control's type is text
}
if ( document.theForm.elements[j].type == "checkbox" )
{
//Perform validation when the control's type is checkbox
}
if ( isNaN (document.theForm.elements[j].value) )
{
//Perform validation if the control's value property does not evaluate to a number
}
if ( Number (document.theForm.elements[j].value) < 0 )
{
//Perform validation if the control's value property evaluates to a number less than 0
}
}
Refer your friends to this blog:
http://programmingcentral.blogspot.com/
Tuesday, May 29, 2007
How to become a blog author
Refer your friends to this blog:
http://programmingcentral.blogspot.com/
Thursday, May 24, 2007
Printing the contents of a IFrame whose content changes dynamically
One of the problems that vexed me recently was how to print
the contents of an IFrame when the content changes dynamically.
- Here is my solution:
Declare a DIV area in the body of the HTML document with an ID attribute value of
"IFrameArea".
Declare a JavaScript function that dynamically assigns an IFrame as the innerHTML
property of the DIV. Note that the dimensions of the IFrame are small. This
has the effect of making it invisible.
function PrintIFrame(SRC)
{
var URL;
URL = (SRC).toString();
document.getElementById('IFrameArea').innerHTML = "<iframe src='"
+ URL + "' height='1' width='1' frameborder='0' ID='MyIFrame' name='MyIFrame'>
</iframe>"
}
- The document that is loaded in the IFrame should have an “onLoad” event
handler declared - onLoad="javascript:PrintDocument()"
delcared in the "Body" tab - The document that is loaded in the IFrame should have a a function to perform
the printing
function SetupToPrint()
{
parent.frames.PrintCounter.focus();
window.print();
}
Refer your friends to this blog:
http://programmingcentral.blogspot.com/
Tuesday, May 22, 2007
Welcome Everyone
Instead of spending hours trying to solve those "difficult" programming problems, stop by and see what your fellow community members think.
We encourage everyone to post questions and answers. Share your hard-earned insights to help make this a thriving community.
All languages and platforms are welcome: .NET, Java, web languages (HTML, JavaScript, VB Script, DHTML, AJAX), and open-source languages.
Welcome to Programming Central!
Refer your friends to this blog:
http://programmingcentral.blogspot.com/