 |
Featured jobs
Featured template
View more templates
 |
 |


Next 5
ClickManager
 |
 |
import com.dataProviders.IntervalMethodCall;
class com.dataProviders.ClickManager
{
private var global_mouseTimer:Number = 0;
private var doubleClickTime:Number = 300;
public var singleClick:Boolean = false;
public var initInterval:Boolean = false;
public var intervalMethodCall:IntervalMethodCall;
public function ClickManager()
{
this.intervalMethodCall = new IntervalMethodCall(this, "validateSingleClick", null, 1, 1)
}
public function detectDoubleClick():Boolean
{
var time:Date = new Date();
var now:Number = time.getTime();
if (now - this.global_mouseTimer < this.doubleClickTime)
{
return true;
}
else
{
this.global_mouseTimer = now;
return false;
}
}
public function detectSingleClick():Boolean
{
this.checkIntervalCall();
if (this.singleClick)
{
this.singleClick = false;
return true;
}
else
{
return false;
}
}
public function checkIntervalCall():Void
{
if (!this.initInterval)
{
this.intervalMethodCall.beginInterval();
this.initInterval = true;
}
}
public function validateSingleClick():Void
{
this.initInterval = false;
this.singleClick = true;
}
}
Posted by: Eric Feminella | website
http://www.ericfeminella.com
|
 |
 |
 |
Copy And Paste Shortcut keys
 |
 |
/*OK so everyone's been going on about how to use the standard Windows copy
and paste keys within Flash. Well here's my solution.*/
// Win. Copy and Paste Functionality, V1
// Jesse Stratford, www.actionscript.org
onClipEvent (enterFrame) {
if (Key.isDown(Key.CONTROL) and Key.isDown(67)) {
if (Selection.getFocus() != null) {
copy = Selection.getFocus();
}
} else if (Key.isDown(Key.CONTROL) and Key.isDown(86)) {
if (Selection.getFocus() != null) {
_root[Selection.getFocus()] = eval(copy);
}
}
}
/*This goes on a controller clip somewhere off stage.
To copy click inside a text field and press Ctrl C, to
paste, click the target field and press Crtl V.*/
Posted by: Jesse Stratford | website
http://www.actionscript.org
|
 |
 |
 |
Copy the contents of one textfield and paste them into another
 |
 |
onClipEvent (enterFrame) {
if (Key.isDown(17) && Key.isDown(67)) {
Selection.setFocus("_root.text") && Selection.setFocus("_root.text2");
} else if (Key.isDown(17) && Key.isDown(86)) {
Selection.setFocus("_root.text2");
_root.text2 = _root.text;
}
}
First the user presses control C to copy, then control V to paste to a textfield.
The above example works in HTML and gets around the focus problem by setting the focus at the begining.
Unfortuanately it's not very practical as it doesn't set the focus on the first textfield properly. Maybe when I've a little more time I'll try and
work it out.
Posted by: No name | website
http://
|
 |
 |
 |
Make the TAB button setFocus of the next text box in (LEVEL5)- for example
 |
 |
In the following example I load my movie with the text boxes into level5. All the actions focusing the text boxes are in the level 5 movie:
Level 5 Movie:
1) First set the focus of your text box in frame 1:
Selection.setFocus("box1");
This means the end user will be presented with a blinking cursor when the movie first loads.
2) Place the following action on an 'invisible button':
on (keyPress "<Tab>") {
if (Selection.getFocus() == "_level5.box1") {
Selection.setFocus("box2");
} else if (Selection.getFocus() == "_level5.box2") {
Selection.setFocus("box3");
} else if (Selection.getFocus() == "_level5.box3") {
Selection.setFocus("box4");
} else if (Selection.getFocus() == "_level5.box4") {
Selection.setFocus("box1");
}
}
Change the variable names to the ones of your choice. You could have box1 leading onto box4 etc.
Posted by: No name | website
http://
|
 |
 |
 |
Random External Picture Selector
 |
 |
n = Math.round(Math.random() * 2);
if (n <= 0) {
gotoAndPlay(1);
}
else if (n >= 3) {
n = 2;
}
else {
loadMovie ('...\images\contact\image' + n + '.jpg', 'loadMovie');
}
Posted by: Travis Fitzgerald | website
http://www.copirite.com.au
|
 |
 |
 |
Next
5
|  |
Search Entire Site
Advertisements
Latest New Articles
- Set up a simple IIS Server for Flash
by Peter McBride - Day 1 at FITC Toronto 2008
by Anthony Pace - Simple reflection effect with AS2
by Jean André Mas - ActionScript.org Meets Josh Tynjala (aka dr_zeus)
by ActionScript.org Staff - Rapidly Create Online Flash Movies to Help Users Market, Sell and Support Software and Hardware
by Sabrina F
|
 |