Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
continuity #1
Re: Detect F10 Key.isDown
there is a way around this issue... however, it does not stop windows from
reporting the F10 key press to the flash player... the result is, what ever
function you assign to the F10 key press is fired, but the movie looses focus
to the player window... if your movie is not keyboard based this should not be
an issue...
all that said, create a new symbol 'of the movie clip variety' and place the
following code in the actions layer...
#initclip
function F10Listener(){}
F10Listener.prototype = new MovieClip();
F10Listener.prototype.onLoad = function(){
if (typeof(this.inited) == "undefined"){
this.inited = new Boolean(true);
this.f10Press = new Boolean(false);
}
if((this.cbFunction) ? this.setCbFunct(this.cbFunction) : null);
}
F10Listener.prototype.onEnterFrame = function(){
this.runCbFunct(this);
}
F10Listener.prototype.setCbFunct = function(handler,location){
this.location = (arguments.length < 2) ? this._parent : location;
this.action = handler;
}
F10Listener.prototype.runCbFunct = function(){
this.location[this.action](this);
}
Object.registerClass("F10Listener",F10Listener);
#endinitclip
set the linkage identifier to 'F10Listener'...
right click the symbol in the library and select 'Component Definition' and
create a parameter called cbFunction...
drag an instance of the symbol onto the stage and in the same time line create
a function...
then set the cbFunction parameter to the function name ( minus the brackets
)...
or if you want to do it in action script... create a function and pass the
function name and the location where it resides to the setCbFunct method of the
F10Listener instance ( remember to name the instance if you want to do this
)... if the function resides in the same time line as the F10Listener instance,
you can omit the location, the component will assume the function location...
function cbFunctionName(){
// called by the F10/Select key...
if (Key.isDown(121) && calledBy.f10Press != true){
trace('do some stuff");
}
}
F10Listener.setCbFunct("cbFunctionName",this);
if you read the code and try to make it your own, you will realise that this
is component polls for the F10 key press at whatever frame rate your movie runs
at, hence the f10Press boolean only allows the cbFunction to fire once...
depending on your application this may need some tweaking...
hope this helps...
continuity
continuity Guest
-
Detect Directory
Is there any way to detect the fully qualified directory that the requesting file resides in. For example, if my page was... -
problem with key.isDown
Hi, Some people at work asked for an fdisk simulator, so they could run it whilst they had customers on the phones, so imagine the screenshots... -
Please explain this Key.isDown glitch...
I have the following line of code placed on a keyframe in my movie which is producing inconsistent results (described below) in different evironments... -
Detect IE vs. Anything Else
Take a look at Request.ServerVariables("HTTO_USER_AGENT") You may want to look a little further than just IE. Like, if someone is using IE 2.0,... -
how do I detect the version of OS in a Mac?
hi there, My problem is that i don't know how to detect which version of OS has certain Mac, like Classic, 10,10.1,10.2 or 10.3 thanks in...



Reply With Quote

