≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
JS Actions: about the use of: me... or this...
Posted by:
(you are not logged in)
Enter the missing letter in: "Interna?ional"
(you are not logged in)
Text:
[quote][b]crusly[/b] wrote: Hi Niko, Watching the code on the [b]action_DoLater.js[/b] , [b]action_FadeScreen.js[/b] and others...(downloaded from CC website), and notice some parts the use of [b]"me."[/b] instead of [b]"this."[/b] [code] action_DoLater = function() { }; action_DoLater.prototype.execute = function(currentNode) { [b]var me = this; [/b] [b]this.[/b]registeredFunction = function() { [b]me.[/b]doLaterFunc(); }; ccbRegisterOnFrameEvent([b]me.[/b]registeredFunction); [b]this.[/b]startTime = (new Date()).getTime(); [b]this.[/b]endTime = this.startTime + [b]this.[/b]TimeMs; [b]this.[/b]currentNode = currentNode; } action_DoLater.prototype.doLaterFunc = function() { var now = (new Date()).getTime(); if (now > [b]this.[/b]endTime) { ccbInvokeAction([b]this.[/b]ActionToDo, [b]this.[/b]registeredFunction); ccbUnregisterOnFrameEvent([b]this.[/b]registeredFunction); } } [/code] This is [b]necesary[/b]?.. or is used this way only for [b]readability[/b] reason? ...There be any problem if only use [b]this.[/b] on all the code?[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact