


Opinions, Technical Web stuff, Lots of JavaScript and possibly some mathematical stuff and other oddities from Eyal Peleg's life, work, and play.
If you develop Flash widgets or application you might (and should) be familiar with the flash log.
One of the biggest issues with this log is that all the warnings and trace messages just pile up there regardless of what swf sent them.
Here are two simple tips to trace the "Warning: name is not a function" messages:
1. The reason you get those is because you are trying to call a function on some variable does not have such a function in its prototype chain.
2. To be able to identify what line in your code is causing those messages you can force the player to write out "Comments" into the log using the following syntax:
({}).THIS_IS_A_COMMENT_TO_THE_LOG()
This will trigget the same type of warning and so by placing several distinct such comments you can narrow the search and find the code line at fault.
As you probably noticed (if you are reading this)
I have decided to add Gigya Socialize to my blog, (seemed only reasonable).
When you read a blog entry on my blog it will be reported to as an action you preformed and you can see both your friends actions and your own on the bottom of the right sidebar.
You can also read what was written about un in techrunch:
Gigya Socialize Goes Up Against Google Friend Connect.
Feel free to tell me what you think about this.
Lately I have beeing looking at ways to optimize some actionscript 2.0 code.
I had two goals, the first was to reduce the size of the .swf file and the second was to make some parts of it faster at runtime.
I will try and write a series of posts describing what I have learned and still am learning from this.
Generally speaking - in most cases optimizing for speed comes at the expence of space and vice versa. also there are isues with how easy the code is to maintain after optimizing. With all that in mind I started looking at my code.
At first I was looking at the code at the action script level, but very soon i decided that If I realy want to understand what is gooing on under the hood I will have to look at bytecode (or actually P-Code at that stage).
Tools
push 'com'
getVariable
push 'name'
getMember
push 'space'
getMember
push 'parts'
getMember
push 'functionName'
getMember
class com.epeleg.utils.Debug {
public static function traceThis(s) {
trace(s)
}
}
import com.epeleg.utils.Debug;
class Main
{
public static function main():Void
{
Debug.traceThis('hello');
Debug.traceThis('world');
}
}
movie 'PATH_TO_MY_SWF.swf' compressed // flash 8, total frames: 1, frame rate: 30 fps, 800x600 px
defineMovieClip 20480 // total frames: 1
end // of defineMovieClip 20480
exportAssets
20480 as '__Packages.Main'
end // of exportAssets
initMovieClip 20480
constants 'Main', '_global', 'prototype', 'main', 'hello', 'com', 'epeleg', 'utils', 'Debug', 'traceThis', 'world', 'ASSetPropFlags'
push 'Main'
getVariable
not
not
branchIfTrue label1
push '_global'
getVariable
push 'Main'
function2 () (r:1='this', r:2='super')
end // of function
setRegister r:0
setMember
push r:0, 'prototype'
getMember
setRegister r:1
pop
push r:0, 'main'
function2 () (r:1='this')
push 'hello', 1, 'com'
getVariable
push 'epeleg'
getMember
push 'utils'
getMember
push 'Debug'
getMember
push 'traceThis'
callMethod
pop
push 'world', 1, 'com'
getVariable
push 'epeleg'
getMember
push 'utils'
getMember
push 'Debug'
getMember
push 'traceThis'
callMethod
pop
end // of function
setMember
push 1, NULL, r:1, 3, 'ASSetPropFlags'
callFunction
pop
label1:
end // of initMovieClip 20480
defineMovieClip 20481 // total frames: 1
end // of defineMovieClip 20481
exportAssets
20481 as '__Packages.com.epeleg.utils.Debug'
end // of exportAssets
initMovieClip 20481
constants 'com', 'epeleg', 'utils', 'Debug', '_global', 'Object', 'prototype', 'traceThis', 'ASSetPropFlags'
push 'com'
getVariable
push 'epeleg'
getMember
push 'utils'
getMember
push 'Debug'
getMember
not
not
branchIfTrue label4
push 'com'
getVariable
not
not
branchIfTrue label1
push '_global'
getVariable
push 'com', 0, 'Object'
new
setMember
label1:
push 'com'
getVariable
push 'epeleg'
getMember
not
not
branchIfTrue label2
push '_global'
getVariable
push 'com'
getMember
push 'epeleg', 0, 'Object'
new
setMember
label2:
push 'com'
getVariable
push 'epeleg'
getMember
push 'utils'
getMember
not
not
branchIfTrue label3
push '_global'
getVariable
push 'com'
getMember
push 'epeleg'
getMember
push 'utils', 0, 'Object'
new
setMember
label3:
push '_global'
getVariable
push 'com'
getMember
push 'epeleg'
getMember
push 'utils'
getMember
push 'Debug'
function2 () (r:1='this', r:2='super')
end // of function
setRegister r:0
setMember
push r:0, 'prototype'
getMember
setRegister r:1
pop
push r:0, 'traceThis'
function2 (r:2='s') (r:1='this')
end // of function
setMember
push 1, NULL, r:1, 3, 'ASSetPropFlags'
callFunction
pop
label4:
end // of initMovieClip 20481
frame 0
constants 'MTASC_MAIN', 'this', 'Main', 'main'
push 'MTASC_MAIN'
setRegister r:0
pop
push 'this'
getVariable
push 1, 'Main'
getVariable
push 'main'
callMethod
pop
end // of frame 0
end
push r:0, 'main'
function2 () (r:1='this')
push 'hello', 1, 'com'
getVariable
push 'epeleg'
getMember
push 'utils'
getMember
push 'Debug'
getMember
push 'traceThis'
callMethod
pop
push 'world', 1, 'com'
getVariable
push 'epeleg'
getMember
push 'utils'
getMember
push 'Debug'
getMember
push 'traceThis'
callMethod
pop
end // of function
push r:0, 'main'
function2 () (r:1='this')
push 'world','hello', 1, 'com'
getVariable
push 'epeleg'
getMember
push 'utils'
getMember
push 'Debug'
getMember
dup
push 'traceThis'
callMethod
pop
push 'traceThis'
callMethod
pop
end // of function
import com.epeleg.utils.Debug;
class Main
{
public static function main():Void
{
var TR=Debug.traceThis;
TR('hello');
TR('world');
}
}
import com.epeleg.utils.Debug;
class Main
{
public static function main():Void
{
var DGB=Debug;
DGB.traceThis('hello');
DGB.traceThis('world');
}
}
push r:0, 'main'
function2 () (r:1='this')
push 'com'
getVariable
push 'epeleg'
getMember
push 'utils'
getMember
push 'Debug'
getMember
setRegister r:2
pop
push 'hello', 1, r:2, 'traceThis'
callMethod
pop
push 'world', 1, r:2, 'traceThis'
callMethod
pop
end // of function
I was messing around with my linksys trying to set up QoS and ended up resetting it,
loosing my DDNS settings and having to recreate them.
Took enough time for me to sit donw and write this down so that (my) next time would take less.
so here goes:
you would ususally have a single domain (e.g. dyn.yourdomain.com) that you would change dynamically and then have other domains that would map to it using CNAME entries.
If you have dynamic dns services provided by enom (I got mine when I moved to enom from registerfly) and you want your dd-wrt router to do the updating:
1) go to the web interface of your roter - ususally via 192.168.1.1
2) select the setup tab and the DDNS sub tab
3) in the DDNS Service combo choose Custom
4) DYNDNS Server should be set to dynamic.name-services.com
5) for some reason the UI does not allow you to leave out the User Name and Password so I just push _ in each of them
5)Hose Name should be set in our example to dyn.
6) URL should be set to /interface.asp?Command=SetDNSHost&Zone=yourdomain.com&DomainPassword=HEX_PASSWORD_YOU_GOT_FROM_ENOM&HostName=
[Update Aug 11th 2009: based on comment by Greg Bray]
6) URL should be set to /interface.asp?Command=SetDNSHost&Zone=yourdomain.com&DomainPassword=DOMAIN_ACCESS_PASSWORD_YOU_SET_UP&HostName=
To set up the DOMAIN_ACCESS_PASSWORD_YOU_SET_UP use the Domain Access Password field on the General Setting page of the Enom Control panel.
Greg was also kind enough to mention that:
Also, the URL that you listed will use the outgoing ip address as the value for updating the dns record. This should work in most cases, but if you want to specify the IP address for the record you need to include &Address=NEW_VALUE in the update url.[/Update]