JavaScript, HTML5, CSS 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!"
Questions
List of questions waiting for answers.
- //music PVのような作品をみて、やってみたーい!と思ってとりあえず音楽をアップしてみました。ここからどうしたらよいでしょうか?
- // forked from harema's forked from: 音 MathGraphics SoundVisualizer
- // forked from dubfrog's 音 MathGraphics SoundVisualizer
- package {
- import flash.display.*;
- import flash.events.*;
- import flash.filters.*;
- import flash.geom.*;
- import flash.media.*;
- package {
- import flash.display.Sprite;
- import flash.text.TextFormat;
- import flash.text.TextField;
- import flash.text.TextFieldAutoSize;
- import flash.system.ApplicationDomain;
- public class FlashTest extends Sprite {
- public function FlashTest() {
- /**
- * ApplicationDomain.currentDomain って
- // forked from hacker_q2_kpljv's forked from: flash on 2010-6-29
- // forked from hacker_q2_kpljv's flash on 2010-6-29
- /**
- * @author エスケイさんのコードをお借りしました
- */
- package {
- import flash.display.Stage;
- import flash.display.Sprite;
- import flash.text.TextField;
- import flash.events.Event;
- /*
- ゲームのAIを作りたいのですが、制限時間があるとします。
- 選択時間内に_thinkが終わらなかった場合
- とりあえずその時点でのselectionが参照されるようになっていますが、
- もう考え続けないでいいのに考え続けてしまいます。
- 40行目の位置から_think関数を止めたいのですが、可能でしょうか?
- */
- package {
- import flash.events.MouseEvent;
- //TextFieldを元に、シェルみたいなものを作りたい
- //Enterキーが押されたときの処理がうまく動かず、
- //プロンプトが出る時と出ない時がある、スクロールされないなどの場合がある
- package {
- import flash.display.Sprite;
- public class FlashTest extends Sprite {
- public function FlashTest() {
- // write as3 code here..
- var field:ShellField = new ShellField(">");
- field.text = "aaaaaaaaaaaaaaaa";
- /**
- * あなたのイベントハンドラを教えて!
- *
- * 複数のイベント&複数のインスタンスに
- * イベントハンドラを設定するときに
- * みなさんの記述方法の違いを知りたい。
- *
- * [ルール]
- * 画面上に3つのボタンが用意されており、
- * クリックとロールオーバーの
- // forked from hacker_kuukuu's flash on 2009-11-27
- package {
- import flash.display.Sprite;
- public class FlashTest extends Sprite {
- public function FlashTest() {
- // write as3 code here..
- graphics.lineStyle(2,0x000000);
- graphics.lineTo(100,100);
- }
- }
- // forked from hacker_kuukuu's flash on 2009-11-27
- // FORK で コピペ すると できるときと できないときがあります
- // どうしたら よろしいですか?
- package {
- import flash.display.Sprite;
- public class FlashTest extends Sprite {
- public function FlashTest() {
- // write as3 code here..
- /**
- * MOUSE_MOVEの実験
- * @author エスケイ
- *
- * MOUSE_MOVEがいったいどのくらいの間隔でとれるのかの実験。
- *
- * ■分かったこと
- * ・15msか16msくらいでとれることが多い。(約60fps相当)
- * ・3回に一階くらい0msでとれてる。どういうことなの?検証方法間違ってる?1ms未満で取得できてるの?
- * ・取得頻度は実行FPSにはよらない。
- // 昨日上げたコードは大きすぎてquestionには不向きでした。
- // 基本に立ち返り、ミニマムコードを。 (海面の奴は別の機会にあげます)
- //
- // オブジェクトにPhongShaderやEnvMapShaderを割り当てて
- // bumpmapを適用すると、3角ポリゴンのエッジ周辺のbumpの一部にエラー(極端に暗くなる)が
- // 表示されます。
- // [Question]この原因がわからない(法線ベクトル関連だと思うのですが・・・)ので、
- // 解決法をご存知の方、よろしくお願いします
- //
- // ※昨日のコードでは 3角ポリゴンのエッジ以外にもエラーが出ていましたが、とりあえず3角ポリゴンの
- // forked from Desuade's Desuade Partigen 2.1 Introduction Example Base File
- // forked from mash's Desuade Partigen 2.1 Introduction Examples
- /*
- Desuade Partigen 2.1 Introduction Examples
- http://desuade.com/partigen
- This .fla goes over the basics of how to use Emitters with Partigen and the Desuade Motion Package
- IMPORTANT!
- // How can I refactor KaleidoImage's render() (line 63) to
- // 1. be more efficient
- // 2. get rid of the subpixel gap
- package {
- import flash.display.Sprite;
- import flash.events.Event;
- public class Kaleidoscope extends Sprite {
- package {
- import flash.display.Sprite;
- public class FlashTest extends Sprite {
- public function FlashTest() {
- // write as3 code here..
- //文字列
- var $str:String = "日本語が正しく表示されません。";
- //表示位置開始座標
- package {
- /*
- 左上に計算時間を
- 型指定なし/型指定あり
- で表示
- */
- import flash.display.Sprite;
- import flash.utils.getTimer;
- import flash.text.TextField;
- public class FlashTest extends Sprite {
- package
- {
- import flash.text.TextField;
- import flash.display.Sprite;
- public class VectorMapTest extends Sprite
- {
- public function VectorMapTest()
- {
- //Vectorのmap()がVectorを返さない気がするのですが気のせいでしょうか?
- package {
- import flash.display.Sprite;
- import flash.display.MovieClip;
- import flash.display.Graphics;
- import flash.text.TextField;
- import flash.events.Event;
- public class FlashTest extends Sprite {
- //力学的エネルギー保存の法則をチコチコ書いてみた。
- //動きはバネ運動。
- //E=0.5*m*v*v+0.5*k*x*x
- package {
- import flash.display.Sprite;
- public class FlashTest extends Sprite {
- public function FlashTest() {
- // write as3 code here..
- }
- }
- }
- // 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 {


















