TOP > Flash,Actionscript Q&A
Flash,Actionscript Q&A feature released!
When you have something you want to do with Flash and Actionscript but you don't know the way to code it,
it's better not to ask for everything, but you'd better go as far as you can and at last, ask somebody for only the rest.
You can do this with wonderfl.
Use wonderfl, to ask questions about your code, and answer others questions.
How to ask: write code, explain your question in the title and comments, and tag it "question"
-> more info about: How to 'ask a question' in Q&A feature
How to answer: fork the question code and modify it
-> more info about: How to answer a question in Q&A feature
How to close question: change "question" tag into "question-closed"
-> more info about: How to close a question in Q&A feature
* It doesn't have to be exactly a Question and Answer, can be a Topic or a Contest which uses wonderfl's fork feature to gather codes.
* for example: "Use this template and write something cool with less than 140 characters!"
List of questions waiting for answers.
- // somebody please optimize this code!
- // source code: http://github.com/mash/ContextFreeArt-AS3
- // This software is a port of ContextFree.js to Actionscript3.
- // Context Free Art is http://www.contextfreeart.org/index.html
- // ContextFree.js is http://code.google.com/p/contextfree/
- // some hints about implementation for improvement
- // ContextFree is a combination of resized primitive shapes:
- /*
- * http://actionsnippet.com/?p=2489
- * を参考に作ってみました。
- *
- * オブジェクトを作って何個載せられるかというゲームにしたかったんですが、
- * ちょっとしたサイズのものでもすぐにバランス崩して倒れてしまうので
- * ゲームとして成立してません。^^;
- *
- * 重さに対する影響度とか指定できないんでしょうか。
- */
- // 普段はthisを書かない派ですが、Tweensyで自身をトゥイーンしたいとき等は仕方なくthisを書きます。
- // でも、イベントハンドラとして渡した無名関数の中では、thisはglobalになってしまうので使えません。
- // だからクロージャーでthisを無名関数内に持ち込むことにしました。
- // ところが"this"は予約語なので、他の名前を付ける必要があります。今回は"self"としてみました。
- // こんなやり方しかないのでしょうか? もっといいやり方があれば教えてください。
- // または、皆さんは普段どのように書いていますか?
- // このやり方では、thisを書かなかったり、書いたり、selfと書いたり、一貫性が無いのが悩みです。
- // コードの先頭で var self = this; と書いてあとはselfだけを使うという手もありますが。。。
- // それか、最も内側でwithされてるインスタンスを取得する方法があればそれがベストかも知れません。
- package {
- /*
- http://wonderfl.net/code/de1743a4ffcb01ff7fa78f3ccc9bc8277e3b16b9#
- 上記のサンプルを実行したのですが、マウスアップで音声が再生されません。
- 似たような録音&再生のサンプルがありますが、どれもダメです。
- FP10.1のインストール以外に何か必要でしょうか?
- OSはXPでブラウザはIE,FF,Chromeなど色々試しました。
- マイクは許可になっており、他のスペクトラム表示のサンプルでは反応しています。
- また、この録音とはPCのローカルハードディスクへ何らかの形式でサウンドを保存して再生しているのでしょうか?
- */
- // I d like to pass a number (id) to the arduino attached to this computer
- // so this id could spread via XBee to another arduino which needs this number
- // to response with a string.
- // Dozo, See the code where HELP is NEEDED.
- package {
- import flash.utils.Timer;
- import flash.display.Sprite;
- import flash.events.Event;
- import funnel.*;
- //How can I draw a circle with dashed line/stroke?
- //Using a for cycle and using the equation of the circle wouldn't it be too slow?
- package {
- import flash.display.Sprite;
- import flash.display.Shape;
- import flash.display.LineScaleMode;
- import flash.display.CapsStyle;
- import flash.display.JointStyle;
- public class DashedCircle extends Sprite {
- /*
- *
- * http://livedocs.adobe.com/flex/3_jp/langref/flash/text/TextField.html#methodSummary
- *
- * livedocのTextFieldのページをみてもgetRawText()の記述が無い(他にもいくつかある)けど
- * これはhtmlTextに渡したhtml文章からhtmlタグをはずした
- * 文章をかえしてくれるってことでいいんでしょうか?
- *
- * */
- package{
- // how can I know if I'm running 465x465 or fullscreen?
- // 465,465 even in
- // http://wonderfl.net/code/79734b4ac942acb8a995a8993ae4b14a7657da8b/fullscreen
- package {
- import flash.display.Sprite;
- import flash.text.*;
- public class FlashTest extends Sprite {
- [SWF(width=465, height=465, backgroundColor=0x999999)]
- public function FlashTest() {
- // forked from hacker_7i4tn9on's forked from: The same brightness looks different.
- // forked from borealkiss's The same brightness looks different.
- /*
- 左側が赤(赤255 = #FF0000)と黒(#000000)を使って
- チェック柄に塗りつぶした四角形、
- 右側が明るさ半分の赤(赤128 = #800000)で塗りつぶした四角形。
- チェック柄が見えなくなるぐらい十分離れた位置から見ると
- どちらの四角形も同じ”半分の明るさの赤色”に見えるはずだが。
- */

















