Monthly Archives: July 2005

嵌套函数定义、与世隔绝的作用域

  在一个php文档里,function的定义可以出现在call之前,也可以出现在其后。然而inner function(function 里面定义的function)并不是这样的,必须“先定义,再调用”。 <?php f1(); function f1() { f2(); function f2() { echo ‘f2’; } } ?> ——————– Fatal error: Call to undefined function: f2() in xxx.php on line 5 这样才行 <?php f1(); function f1() { function f2() { … Continue reading

Posted in PHP Rocks | 4 Comments

Yet Another Bug of V2 — ScrollPane doesn’t emit “scroll” event when the content being dragged

  Remember to place super in the correct scope when programing!   Testing environment: 23:51 2005-7-28 Windows Server 2003 sp1 Macromedia Flash Player 7.0  r19 V2 Component ScrollPane 2.0.1.78   Class mx.containers.ScrollPane   The ScrollPane component has an event named … Continue reading

Posted in Flash and ActionScript | 9 Comments

PHP session 小结

初学php,自己弄个小结:) Hope it can be helpful!    PHP Session How a session starts? Automatically if session.auto_start is set to 1 Explicitly through session_start() Implicitly through session_register() In your php.ini session.save_path should be set to a valid path, I find sometimes the … Continue reading

Posted in PHP Rocks | 1 Comment

嵌套MovieClip时尺寸的编程陷阱

呵呵:) 发个中文的~~   新建三个MovieClip symbol,命名为symbol_inner1、symbol_inner2和symbol_container。symbol_inner1里面画一个100*100的正方形,位置为(0,0)。symbol_inner2里面画一个50*50的正方形,位置为(0,0)。在symbol_container中添加symbol_inner1、symbol_inner2的instance各一个,分别命名为m1和m2,位置均设为(0,0)。回到根舞台,添加symbol_container的instance,命名为m。     下面分别改变三个MovieClip的_width/_height、_xscale/_yscale。测试工具是AcmeWebWorks的AdminTool beta 1.1.1。 将m1的_width改为200,m2的_height改为200,m的_width和_height分别变成了200和200.3(误差)。m的_xscale和_yscale均为原来的100。 将m的_width该为200,看上去m1和m2也跟着变了。但事实上用AS访问,m1和m2的_width和_xscale仍为原来的值!这可是超级大陷阱! 结论 尺寸和scale总是相挂钩,保持一致。 尺寸有可能由误差,因此用if(_width == 200)要注意了! Container MC的尺寸由所有inner MC共同决定,为能包含所有inner MC的最小矩形。 Container MC的尺寸被直接改变后,inner MC的尺寸保持不变!(外面不影响里面) inner MC的尺寸改变后,Container MC会受影响。(里面要影响外面) 另外一个根尺寸有关的陷阱,Luar讲过。 “假設有一個Movie Clip(mc),裡面畫了一個100*100正方形,上面被一個50*50的正方形Mask了。將Movie Clip放在Stage,Info Panel說Movie Clip的寬高度都是50;可惜事與願違,ActionScript卻說Movie Clip的寬高度都是100。這樣毛病使編程人員難以知道Movie Clip是否到達某位置,ActionScript上到了,但視覺上根本未到。我寫了一個地圖Zoom in Zoom out應用程序,一直沒有問題;直到美工用Mask去做Movie Clip,就發生問題,用ActionScript拿不到準確地圖邊緣位置,使移動時會衝過了。這個編程陷阱,害我Debug了兩晚,XYZ!@#。” 原文在<http://www.luar.com.hk/flashbook/archives/001070.php&gt; … Continue reading

Posted in Flash and ActionScript | 4 Comments

Flash Player8 Public Beta

Macromedia announced a public beta version of Flash Player 8, this pre-release is of version WIN 8.0.0.434(for windows).   It can be said for certain that Macromedia has added kind of download and run back door in the Flash Player. … Continue reading

Posted in Flash and ActionScript | Leave a comment

Final Exams Finished!

By today, July 14th, 2005, I have finished all my final tests of the last semester of my 2nd year in college, which means that I’m no longer a sophomore but a 3rd year student. Oh my dear Lord, how can … Continue reading

Posted in Life | Leave a comment

How to view my previous post “About her”?

Thanks for your interest. But the content won’t please you unless… You will see it only if you are an ActionScript fan 🙂 The fun for you may lie in the algorithm anyhow. //ActionScript function decode(src:String):String {  var base64chars:String = … Continue reading

Posted in Life | Leave a comment