9월 20일 오늘 스터디에서는 각자 만들어온 플래시에 대해 설명하고 제작할때 생긴 문제에 대해 질문하고 함께 풀어보고 트윈 클래스와 배열에 대해서 이해하는 시간을 가졌고 즉석에서 플래시 네비게이션을 만들어보는 시간을 가졌습니다. 10월 4일 스터디 과제는 이번에 학습한 몇가지를 응용하셔서 플래시 그래프와 전광판을 만들어보는 것입니다. 하단에 있는 자료들을 참고하시면 도움이 될 것입니다.
그리고 과제는 반드시 직접 해보시고 잘 안되는 부분에 대해 질문할 내용을 준비해두세요.
웹프로그래머의 홈페이지 정보 블로그 http://hompy.info
[제3회 스터디 학습 자료]
세로형 네비게이션 액션 스크립트 소스 - flashmenu.as
아래 소스는 몇년전 플래시에 대해 제대로 파악하고 있지 못했던 시기에 만든 것으로 부족한 부분이 있을 수 있으나 오히려 입문자를 위한 학습 자료가 될 수 있어 공개합니다.
import flash.geom.ColorTransform;
import flash.geom.Transform;
var mc_max = 8;
var mc_top = 10;
var mc_height = 30;
var mc_sub_height = 20;
var mmc_height = new Array();
var mmc_height_more = 26;
var mc_select = -1;
menu_list = new Array("플래시(Flash)","포토샵(Photoshop)","서비스(Service)","카페(Cafe)","블로그(Blog)");
menu_link = new Array("http://www.hompydesign.com/club/meet.htm","http://www.hompydesign.com/club/ani.htm","http://www.hompydesign.com/showdir.php","http://coordy.cyworld.com/","http://www.hompydesign.com/ex/main_index.htm");
submenu_list = new Array();
submenu_list[0] = new Array("미니홈피","플래시채팅","플래시소스","플래시갤러리","RSS 리더","PHP 사전","한자게임","달력과 시계");
submenu_list[1] = new Array("포토 라이브러리","랜덤 이미지");
submenu_list[2] = new Array("무료 도메인","한글 도메인","블로그 스크랩","미니홈피 갤러리","프로게이머");
submenu_list[3] = new Array("패션 코디 클럽","직장인 인맥만들기","플래시 카페","스타크래프트 클럽");
submenu_list[4] = new Array("블로그","싸이월드 홈2","미니홈피","게시판");
submenu_link = new Array();
submenu_link[0] = new Array("http://www.hompydesign.com/club/flash.htm","http://www.hompydesign.com/flash/chat.htm","http://www.hompydesign.com/club/flash_movie.php","http://www.hompydesign.com/club/photo.htm","http://www.hompydesign.com/club/xmlreader.htm","http://www.hompydesign.com/flash/phpdic/phpdic.htm","http://www.hompydesign.com/hanja/","http://www.hompydesign.com/club/calendar.htm");
submenu_link[1] = new Array("http://www.hompydesign.com/club/photolib.html","http://www.hompydesign.com/club/ani.htm","","","","","","","");
submenu_link[2] = new Array("http://www.hompydesign.com/showdir.php","http://www.hompydesign.com/club/korean_domain.php","http://www.hompydesign.com/club/post.com","http://www.hompydesign.com/club/photo_list.com","http://www.hompydesign.com/club/rank_write_starcraft.com","","","");
submenu_link[3] = new Array("http://coordy.cyworld.com/","http://makehost.cyworld.com/","http://cafe.naver.com/q69.cafe","http://starcraft.or.kr/","","","");
submenu_link[4] = new Array("http://hompy.info","http://www.cyworld.com/onblog","http://www.cyworld.com/makehost","http://www.hompydesign.com/ex/main_index.htm","","","");
ready();
function text_over(){
this.title_tf.textColor = 0xFFFFFF;
}
function text_out(){
this.title_tf.textColor = 0xE8EB91;
}
function text_click(){
getURL(this.link,"_main_");
}
function ready() {
for (i=0;i<mc_max;i++) {
var obj = this["mc_"+i];
obj.targetX = 0;
obj.targetY = mc_height * i;
obj.speedX = 0.2;
obj.speedY = 0.2;
obj.mlist._visible = false;
obj.submenu._visible = false;
obj.mlist_head._visible = false;
obj.mlist_tail._visible = false;
obj.main.onRollOver = move_mc;
obj.main.title = menu_list[i];
obj.main.title_tf.textColor = 0xfdffc7;
obj.main._xscale = 100;
obj.main._yscale = 100;
obj.no = i;
obj.main.link = menu_link[i];
obj.main.onRelease = text_click;
for (j in submenu_list[i]){
obj.submenu["title"+j].str = submenu_list[i][j];
obj.submenu["title"+j].onRollOver = text_over;
obj.submenu["title"+j].onRollOut = text_out;
obj.submenu["title"+j].link = submenu_link[i][j];
obj.submenu["title"+j].onRelease = text_click;
}
for (j=submenu_list[i].length;j<mc_max;j++) obj.submenu["title"+j]._visible = false;
obj.submenu["title"+(submenu_list[i].length-1)].line_mc._visible = false;
obj.mlist._visible = false;
obj.over_mc._visible = false;
mmc_height[i] = submenu_list[i].length*mc_sub_height;
}
}
first_mc(0);
function first_mc(menu_no){
for (i=0;i<mc_max;i++) {
var obj = _root["mc_"+i];
/*
var colorTrans:ColorTransform = new ColorTransform();
var trans:Transform = new Transform(obj.over_mc);
*/
obj.main._xscale = 100;
obj.main._yscale = 100;
if (menu_no==i) {
obj.main.title_tf.textColor = 0xfdffc7;
obj.mlist._height = mmc_height[i];
//obj.mlist_tail._y = obj.mlist._y + mmc_height[i];
obj.submenu._visible = true;
obj.mlist._visible = true;
obj.mlist_head._visible = true;
obj.mlist_tail._visible = true;
obj.over_mc._visible = true;
//colorTrans.rgb = 0x0000ff; trans.colorTransform = colorTrans;
if (obj.no != mc_select) {
//obj.main.onEnterFrame = show_mainmc;
obj.submenu.gotoAndPlay(1);
obj.submenu._alpha = 10;
obj.submenu.onEnterFrame = show_submc;
obj.mlist._alpha = 10;
obj.mlist._height = 1;
obj.mlist.onEnterFrame = show_submc_h;
obj.mlist_head._alpha = 10;
obj.mlist_head.onEnterFrame = show_submc;
obj.mlist_tail._alpha = 10;
obj.mlist_tail.onEnterFrame = show_submc;
}
} else {
obj.over_mc._visible = false;
obj.main.title_tf.textColor = 0xfdffc7;
obj.mlist._visible = false;
obj.submenu._visible = false;
obj.mlist_head._visible = false;
obj.mlist_tail._visible = false;
colorTrans.rgb = 0x00ccff; trans.colorTransform = colorTrans;
}
obj.targetY = mc_top + mc_height * i;
if (menu_no < i) obj.targetY += mmc_height[menu_no]+ mmc_height_more;
//trace(obj.no+':'+obj.targetY);
obj.onEnterFrame = go_mc;
}
mc_select = menu_no;
}
function move_mc(){
for (i=0;i<mc_max;i++) {
var obj = _root["mc_"+i];
/*
var colorTrans:ColorTransform = new ColorTransform();
var trans:Transform = new Transform(obj.over_mc);
*/
obj.main._xscale = 100;
obj.main._yscale = 100;
if (this._parent.no==i) {
obj.main.title_tf.textColor = 0xfdffc7;
obj.mlist._height = mmc_height[i];
//obj.mlist_tail._y = obj.mlist._y + mmc_height[i];
obj.submenu._visible = true;
obj.mlist._visible = true;
obj.mlist_head._visible = true;
obj.mlist_tail._visible = true;
obj.over_mc._visible = true;
//colorTrans.rgb = 0x0000ff; trans.colorTransform = colorTrans;
if (obj.no != mc_select) {
//obj.main.onEnterFrame = show_mainmc;
obj.submenu.gotoAndPlay(1);
obj.submenu._alpha = 10;
obj.submenu.onEnterFrame = show_submc;
obj.mlist._alpha = 10;
obj.mlist._height = 1;
obj.mlist.onEnterFrame = show_submc_h;
obj.mlist_head._alpha = 10;
obj.mlist_head.onEnterFrame = show_submc;
obj.mlist_tail._alpha = 10;
obj.mlist_tail.onEnterFrame = show_submc;
}
} else {
obj.over_mc._visible = false;
obj.main.title_tf.textColor = 0xfdffc7;
obj.mlist._visible = false;
obj.submenu._visible = false;
obj.mlist_head._visible = false;
obj.mlist_tail._visible = false;
colorTrans.rgb = 0x00ccff; trans.colorTransform = colorTrans;
}
obj.targetY = mc_top + mc_height * i;
if (this._parent.no < i) obj.targetY += mmc_height[this._parent.no]+ mmc_height_more;
//trace(obj.no+':'+obj.targetY);
obj.onEnterFrame = go_mc;
}
mc_select = this._parent.no;
}
function show_mainmc(){
if (this._xscale<110) {
this._xscale += 2;
if (this._xscale > 110) this._xscale = 110;
this._yscale = this._xscale;
} else {
this.onEnterFrame = null;
}
}
function show_submc(){
if (this._alpha<100) {
this._alpha += 10;
if (this._alpha > 100) this._alpha = 100;
} else {
this.onEnterFrame = null;
}
}
function show_submc_h(){
if (this._alpha<100) {
this._alpha += 10;
if (this._alpha > 100) this._alpha = 100;
this._height = mmc_height[this._parent.no]*this._alpha / 100;
this._parent.mlist_tail._y = this._y + this._height;
} else {
this.onEnterFrame = null;
}
}
function go_mc() {
var obj = this;
var len = (obj._x - obj.targetX)*(obj._x - obj.targetX)+(obj._y - obj.targetY)*(obj._y - obj.targetY)/2;
if (len < 1){
obj._x = obj.targetX;
obj._y = obj.targetY;
obj.onEnterFrame = null;
}
obj._x = obj._x + obj.speedX*(obj.targetX - obj._x);
obj._y = obj._y + obj.speedY*(obj.targetY - obj._y);
}
[제4회 스터디 학습 과제]
1차원 배열과 Tween 클래스를 이용해서 전광판을 만들어보세요.
전광판 참고 URL : http://hompy.info/204
2차원 배열과 Tween 클래스를 이용해서 그래프를 만들어보세요.
그래프 참고 URL : http://hompy.info/192
[Tween 클래스 참고 게시물]
http://cafe.naver.com/q69/38901
http://cafe.naver.com/q69/115118
[플래시 배열 참고 게시물]
http://cafe.naver.com/q69/115164
[html에서 플래시로 변수 전달 참고 게시물]
http://cafe.naver.com/q69/7386
그리고 과제는 반드시 직접 해보시고 잘 안되는 부분에 대해 질문할 내용을 준비해두세요.
웹프로그래머의 홈페이지 정보 블로그 http://hompy.info
[제3회 스터디 학습 자료]
세로형 네비게이션 액션 스크립트 소스 - flashmenu.as
아래 소스는 몇년전 플래시에 대해 제대로 파악하고 있지 못했던 시기에 만든 것으로 부족한 부분이 있을 수 있으나 오히려 입문자를 위한 학습 자료가 될 수 있어 공개합니다.
import flash.geom.ColorTransform;
import flash.geom.Transform;
var mc_max = 8;
var mc_top = 10;
var mc_height = 30;
var mc_sub_height = 20;
var mmc_height = new Array();
var mmc_height_more = 26;
var mc_select = -1;
menu_list = new Array("플래시(Flash)","포토샵(Photoshop)","서비스(Service)","카페(Cafe)","블로그(Blog)");
menu_link = new Array("http://www.hompydesign.com/club/meet.htm","http://www.hompydesign.com/club/ani.htm","http://www.hompydesign.com/showdir.php","http://coordy.cyworld.com/","http://www.hompydesign.com/ex/main_index.htm");
submenu_list = new Array();
submenu_list[0] = new Array("미니홈피","플래시채팅","플래시소스","플래시갤러리","RSS 리더","PHP 사전","한자게임","달력과 시계");
submenu_list[1] = new Array("포토 라이브러리","랜덤 이미지");
submenu_list[2] = new Array("무료 도메인","한글 도메인","블로그 스크랩","미니홈피 갤러리","프로게이머");
submenu_list[3] = new Array("패션 코디 클럽","직장인 인맥만들기","플래시 카페","스타크래프트 클럽");
submenu_list[4] = new Array("블로그","싸이월드 홈2","미니홈피","게시판");
submenu_link = new Array();
submenu_link[0] = new Array("http://www.hompydesign.com/club/flash.htm","http://www.hompydesign.com/flash/chat.htm","http://www.hompydesign.com/club/flash_movie.php","http://www.hompydesign.com/club/photo.htm","http://www.hompydesign.com/club/xmlreader.htm","http://www.hompydesign.com/flash/phpdic/phpdic.htm","http://www.hompydesign.com/hanja/","http://www.hompydesign.com/club/calendar.htm");
submenu_link[1] = new Array("http://www.hompydesign.com/club/photolib.html","http://www.hompydesign.com/club/ani.htm","","","","","","","");
submenu_link[2] = new Array("http://www.hompydesign.com/showdir.php","http://www.hompydesign.com/club/korean_domain.php","http://www.hompydesign.com/club/post.com","http://www.hompydesign.com/club/photo_list.com","http://www.hompydesign.com/club/rank_write_starcraft.com","","","");
submenu_link[3] = new Array("http://coordy.cyworld.com/","http://makehost.cyworld.com/","http://cafe.naver.com/q69.cafe","http://starcraft.or.kr/","","","");
submenu_link[4] = new Array("http://hompy.info","http://www.cyworld.com/onblog","http://www.cyworld.com/makehost","http://www.hompydesign.com/ex/main_index.htm","","","");
ready();
function text_over(){
this.title_tf.textColor = 0xFFFFFF;
}
function text_out(){
this.title_tf.textColor = 0xE8EB91;
}
function text_click(){
getURL(this.link,"_main_");
}
function ready() {
for (i=0;i<mc_max;i++) {
var obj = this["mc_"+i];
obj.targetX = 0;
obj.targetY = mc_height * i;
obj.speedX = 0.2;
obj.speedY = 0.2;
obj.mlist._visible = false;
obj.submenu._visible = false;
obj.mlist_head._visible = false;
obj.mlist_tail._visible = false;
obj.main.onRollOver = move_mc;
obj.main.title = menu_list[i];
obj.main.title_tf.textColor = 0xfdffc7;
obj.main._xscale = 100;
obj.main._yscale = 100;
obj.no = i;
obj.main.link = menu_link[i];
obj.main.onRelease = text_click;
for (j in submenu_list[i]){
obj.submenu["title"+j].str = submenu_list[i][j];
obj.submenu["title"+j].onRollOver = text_over;
obj.submenu["title"+j].onRollOut = text_out;
obj.submenu["title"+j].link = submenu_link[i][j];
obj.submenu["title"+j].onRelease = text_click;
}
for (j=submenu_list[i].length;j<mc_max;j++) obj.submenu["title"+j]._visible = false;
obj.submenu["title"+(submenu_list[i].length-1)].line_mc._visible = false;
obj.mlist._visible = false;
obj.over_mc._visible = false;
mmc_height[i] = submenu_list[i].length*mc_sub_height;
}
}
first_mc(0);
function first_mc(menu_no){
for (i=0;i<mc_max;i++) {
var obj = _root["mc_"+i];
/*
var colorTrans:ColorTransform = new ColorTransform();
var trans:Transform = new Transform(obj.over_mc);
*/
obj.main._xscale = 100;
obj.main._yscale = 100;
if (menu_no==i) {
obj.main.title_tf.textColor = 0xfdffc7;
obj.mlist._height = mmc_height[i];
//obj.mlist_tail._y = obj.mlist._y + mmc_height[i];
obj.submenu._visible = true;
obj.mlist._visible = true;
obj.mlist_head._visible = true;
obj.mlist_tail._visible = true;
obj.over_mc._visible = true;
//colorTrans.rgb = 0x0000ff; trans.colorTransform = colorTrans;
if (obj.no != mc_select) {
//obj.main.onEnterFrame = show_mainmc;
obj.submenu.gotoAndPlay(1);
obj.submenu._alpha = 10;
obj.submenu.onEnterFrame = show_submc;
obj.mlist._alpha = 10;
obj.mlist._height = 1;
obj.mlist.onEnterFrame = show_submc_h;
obj.mlist_head._alpha = 10;
obj.mlist_head.onEnterFrame = show_submc;
obj.mlist_tail._alpha = 10;
obj.mlist_tail.onEnterFrame = show_submc;
}
} else {
obj.over_mc._visible = false;
obj.main.title_tf.textColor = 0xfdffc7;
obj.mlist._visible = false;
obj.submenu._visible = false;
obj.mlist_head._visible = false;
obj.mlist_tail._visible = false;
colorTrans.rgb = 0x00ccff; trans.colorTransform = colorTrans;
}
obj.targetY = mc_top + mc_height * i;
if (menu_no < i) obj.targetY += mmc_height[menu_no]+ mmc_height_more;
//trace(obj.no+':'+obj.targetY);
obj.onEnterFrame = go_mc;
}
mc_select = menu_no;
}
function move_mc(){
for (i=0;i<mc_max;i++) {
var obj = _root["mc_"+i];
/*
var colorTrans:ColorTransform = new ColorTransform();
var trans:Transform = new Transform(obj.over_mc);
*/
obj.main._xscale = 100;
obj.main._yscale = 100;
if (this._parent.no==i) {
obj.main.title_tf.textColor = 0xfdffc7;
obj.mlist._height = mmc_height[i];
//obj.mlist_tail._y = obj.mlist._y + mmc_height[i];
obj.submenu._visible = true;
obj.mlist._visible = true;
obj.mlist_head._visible = true;
obj.mlist_tail._visible = true;
obj.over_mc._visible = true;
//colorTrans.rgb = 0x0000ff; trans.colorTransform = colorTrans;
if (obj.no != mc_select) {
//obj.main.onEnterFrame = show_mainmc;
obj.submenu.gotoAndPlay(1);
obj.submenu._alpha = 10;
obj.submenu.onEnterFrame = show_submc;
obj.mlist._alpha = 10;
obj.mlist._height = 1;
obj.mlist.onEnterFrame = show_submc_h;
obj.mlist_head._alpha = 10;
obj.mlist_head.onEnterFrame = show_submc;
obj.mlist_tail._alpha = 10;
obj.mlist_tail.onEnterFrame = show_submc;
}
} else {
obj.over_mc._visible = false;
obj.main.title_tf.textColor = 0xfdffc7;
obj.mlist._visible = false;
obj.submenu._visible = false;
obj.mlist_head._visible = false;
obj.mlist_tail._visible = false;
colorTrans.rgb = 0x00ccff; trans.colorTransform = colorTrans;
}
obj.targetY = mc_top + mc_height * i;
if (this._parent.no < i) obj.targetY += mmc_height[this._parent.no]+ mmc_height_more;
//trace(obj.no+':'+obj.targetY);
obj.onEnterFrame = go_mc;
}
mc_select = this._parent.no;
}
function show_mainmc(){
if (this._xscale<110) {
this._xscale += 2;
if (this._xscale > 110) this._xscale = 110;
this._yscale = this._xscale;
} else {
this.onEnterFrame = null;
}
}
function show_submc(){
if (this._alpha<100) {
this._alpha += 10;
if (this._alpha > 100) this._alpha = 100;
} else {
this.onEnterFrame = null;
}
}
function show_submc_h(){
if (this._alpha<100) {
this._alpha += 10;
if (this._alpha > 100) this._alpha = 100;
this._height = mmc_height[this._parent.no]*this._alpha / 100;
this._parent.mlist_tail._y = this._y + this._height;
} else {
this.onEnterFrame = null;
}
}
function go_mc() {
var obj = this;
var len = (obj._x - obj.targetX)*(obj._x - obj.targetX)+(obj._y - obj.targetY)*(obj._y - obj.targetY)/2;
if (len < 1){
obj._x = obj.targetX;
obj._y = obj.targetY;
obj.onEnterFrame = null;
}
obj._x = obj._x + obj.speedX*(obj.targetX - obj._x);
obj._y = obj._y + obj.speedY*(obj.targetY - obj._y);
}
[제4회 스터디 학습 과제]
1차원 배열과 Tween 클래스를 이용해서 전광판을 만들어보세요.
전광판 참고 URL : http://hompy.info/204
2차원 배열과 Tween 클래스를 이용해서 그래프를 만들어보세요.
그래프 참고 URL : http://hompy.info/192
[Tween 클래스 참고 게시물]
http://cafe.naver.com/q69/38901
http://cafe.naver.com/q69/115118
[플래시 배열 참고 게시물]
http://cafe.naver.com/q69/115164
[html에서 플래시로 변수 전달 참고 게시물]
http://cafe.naver.com/q69/7386

flashmenu.as
flashmenu.fla

댓글을 달아 주세요