- 2007-01-29 (月)
- action script
気が向いたときに作っている、「Flash で cover flow 表現」ですが、なにやら違うものができてしまい、これはこれで一応アップしておきます。一言で表現すると「爽快感のない cover flow」って感じです。
2/4追記:
細かいバグを修正後、こちらのページでソースファイルごと公開しなおしました。
現状はこんな感じ(>> coverFlowEffect.html)
左右に並ぶ、少しトーン暗めのパネルをクリックすると、それが中央に移動します。中心から2つ目をクリックすると、2回連続して移動します。
まだバグが残っている&コードが未整理なので、ソース公開は後ほど。今回も、世界中のオープンソースの恩恵を享受しながら作業させてもらいました。
- 自作のReflectionクラスにより、鏡面反射効果を生成。
- 実際にはReflectionクラスを拡張させた ReflectionFlipper クラスでコンストラクタしている。このクラスは、変形対象となる画像を、Sandy の DistortImage を使って変形するのだけれど、Distort させる時には頂点となる4点を求める必要があります。
- そこで、どうせやるならリアルに3D計算して4点をプロット(もともと Sandy はバリバリの 3D ライブラリなので、そんな機能は備えているはずだけど、僕がそこまで調べてないだけ、、)しようと思って、「Rotating 3D Marquee Experiment (with Source)」のエンジンを使わせてもらいました。このエンジン(というか考え方)、オリジナルは AndréMichelle さんのこのキューブのサンプル。simple3D という呼称はFlashに限らず使用されるものだそうで、昔からいろんな人が自作(これとかすごい) されてる様子。
- 以上の作業(反射表現・頂点指定による Distort 変形)をクラス上で設定し終えて、やっとfla 上での作業に入りました。
- スクリプトでズラーっと並べ、ReflectionFlipper クラスに登録。各MCをクリックした時の移動やアルファ・明度は全て Fuse で管理、Fuse のシーケンサーを利用することで「3つ隣をクリックした際は3連発で関数発動」みたいな命令が簡単に設定できた。また、 fadeIn, fadeOut メソッドもコードの簡略化に貢献してくれました。
- ムービーの _quality は "LOW" にしてあります。あとは押しっぱなしでスライドし続けるように修正して、バグをとったらソース公開する予定です。
やっぱり、マウスの位置に応じてブワーッと高速スライドしないと、視覚効果としても、UIとしてもイマイチですね。上記リストの「5」の方向性を変更すれば(Fuse は諦めるかも)高速スライドできそうです。
まぁ現状の方向性でも、cover flow に固執しなければ、Vista チックな表現とかは作れそうです。
- Newer: 3D空間を浮遊するナビゲーション
- Older: Flash関連ブクマを del.icio.us でやってます
Comment:47
- Sean McGee 2007-03-26 (月) 14:41
-
I love what you've put together here with Cover Slow. I've tried to figure out how to put specific pictures into each of the images that it cyles through. Ideally I'd like to have 15 unique images that it cycles through. Could you lend any insight on how to do this?
- tera 2007-03-26 (月) 18:16
-
Hello, Sean
This is a first time that I got a comment from other country.
So I'm happy to meet you.
About my "Cover Slow", have you already downloaded the sample & source file?
http://www.trick7.com/blog/swf/coverSlow.htmlThen, Please modify "coverSlow.fla".
And I made a tutorial video that how to display 15 unique JPG images.
http://www.trick7.com/blog/2007/03/26-180930.php
(To watch the video, click the link in the grey div. There is no sound in the video.)If I mistranslate your comment or there is something difficult to understand, please let me know in this comment block.
thank you. - manu 2007-04-10 (火) 07:51
-
Hi tera,
Hello, it is a wonderfull work and thanks for making some profit the community! I will have a small question; how to put a link or a different button on each photo? Can you help me?
Still thank you for your answer,manu (from france)
- tera 2007-04-10 (火) 09:44
-
Hi manu,
Thank you for visit my blog. As for your question, there are a lot of solution:
For instance. Please insert the code below into "coverSlow.fla: line 176"
---------------------------------------------------------------
else if(mc._x==home["guideLine"+centerP]._x){
trace("LINK TO "+mc.index)
}
---------------------------------------------------------------
means, "if a clicked clip is located center, trace the MC's own index number (defined at line 27)."
Thus we can access and trace the center clip, then add some fix in this code for unique link with Array that contains links or something.
I think it's a simplest and logical way.
For bad example, If insert below code in line 28:
---------------------------------------------------------------
mc.onRelease=function(){
trace("CLICKED "+this.index)
};
---------------------------------------------------------------
All the clip on the stage are react. It's not appropriate in this case.Sorry for my poor English. Thank you.
- manu 2007-04-10 (火) 13:53
-
Thank you so much Tera,
It's ok for the link but I have a last question now; How do I make if I want to replace image by movieclip?
For exemple, I want to put 7 movieclip (each with different content).
Can you help me again? Thank you tera! And still "bravo" (wonderfull in french) for your work.Sorry for my very poor English. Yours is very good.
- tera 2007-04-10 (火) 15:55
-
Hi, manu.
I have fixed .fla. Please download and put it in the same folder.
http://www.trick7.com/blog/swf/coverSlow_mcScroll.fla
Please check out the source code. (commented with "//for manu//")I replaced each MovieClip by attachMovie (with LinkageMC).
Then I reduced the number of MC on the stage to put 7 movieclip. But I noticed that if I tryed to put only 7 MC, I had to reduce visiblly MC (means MC shown on the stage) to 3. It's not cool I think.I set a link button with previous way. For example:
http://www.trick7.com/blog/swf/coverSlow_mcScroll.html
Please fix as you want. - manu 2007-04-10 (火) 23:36
-
Hi tera,
I thank you so much... It's exactly what I want but I try to put 7 mc on the stage -3 1 3- not -2 1 2-Is it?
var num:Number = 9;
var lastP:Number = 7;
var centerP:Number = 3; - tera 2007-04-11 (水) 00:13
-
Hi manu
If you want 3|1|3, needs 4|1|4 arrows on the stage.
Thus we need 10(4+1+4+"1")clip.
Now you want 7 clip on 3|1|3, please place 7*2sets clips.
Call the same MC twice with "%".
IDEA:
i=Array(0,1,2,3,4,5,6,7,8,9,10,11,12,13)
(i%7)+1=Array(1,2,3,4,5,6,7,1,2,3,4,5,6,7)source:
http://www.trick7.com/blog/swf/coverSlow_mcScroll2.fla
sample:
http://www.trick7.com/blog/swf/coverSlow_mcScroll2.htmlregards.
- manu 2007-04-11 (水) 01:05
-
Ok thanks Tera, all is ok.
can I ask a last thing?
If I want to put button navigation on the stage, can you tell me the url of the mc1 for exemple?
- tera 2007-04-11 (水) 01:17
-
Hi manu
Sorry I can't understand what you explain.
What do "button navigation" and "url" mean? - manu 2007-04-11 (水) 01:26
-
Sorry,
In fact you have the coverslow and below you have menu.
So you can use mouse or "menu" to navigate.
Sorry for my very bad english ;-). You understand now? - tera 2007-04-11 (水) 02:57
-
Hi manu,
I have fixed upper source and link. Please check out with F5. I added buttons and click to slide.I have found a bug:
line 142: (addNum<=0) must be (addNum<0)There still may be something to adjust.
I feel sleepy and going to bed.
Please enjoy with my coverSlow. thank you. - manu 2007-04-11 (水) 03:42
-
Thanks again for your help tera, it's ok.
Have a good night,
- manu 2007-04-11 (水) 10:22
-
Hi tera,
"There still may be something to adjust" but it is very good!
I would want to put text field in my_mc3 for exemple but nothing apen, He don't want to load xml, I don't understand the problem...For exemple:
I put a text field (with instance name"cadre") in my_mc3 and the actionscript:
------------------------------------------------------------------------
function chargeXML() {
var contact_xml:XML = new XML();
contact_xml.ignoreWhite = true;
contact_xml.load("http://www.monsite.com/monxml.xml");
contact_xml.onLoad = function(success) {
if (success) {
_root.mc.my_mc3.cadre.text = contact_xml.firstChild.toString();
}
};
}
this.chargeXML();
this.stop();
--------------------------------------------------------------------------
Have you got an idea?still thank you Tera...
- manu 2007-04-12 (木) 02:01
-
Hi tera,
did you receive my last message?
I try to put a simple action exemple/
I put a mc with instance name cible in my_mc3 and want to load an external image in cible with this actionscript:
cible.loadMovie("http://www.monsite.com/imageshome/home_1_1.jpg");But it is not work! Don't want to load external files in the attachmovie... Is it normal?
Thank's again for your help.
Emmanuel
- tera 2007-04-12 (木) 09:21
-
Hi manu,
Sorry, I can't understand what you explain again...
But I think that "Load external files" or "loadMovie" is beyond the scope of this topic.
Please check out other helpful source. Thank you. - manu 2007-04-13 (金) 01:39
-
Ok tera,
thank you again... - tera 2007-04-13 (金) 12:42
-
Hi manu
I have found your past comment just now.
My Blog often treat some comment as a spam automatically. Sorry for that.Then I checked your code, but I couldn't find something strange at once, because I'm not a brilliant coder...
I am a typical "try and error" coder :) - manu 2007-04-15 (日) 07:43
-
Hi Tera,
It's me again, oups!
Do you think it's possible to load dinamicaly, the content of the each movie clip (for exemple photo)? Have you got an idea, because I try to put in each attachmovie a loadmovie but don't work.
Thank you so much Tera for your answer... Please...
- tera 2007-04-15 (日) 09:51
-
Hi manu,
I think it's possible to do as you want.
I had deleted the whole data (includeing extra images) from my local PC, so I can't show you a sample file. but
1. load external XML file or name succeeding name (for example image1.jpg to image7.jpg).
2. attachMovie (my_mc1 to my_mc7)
3. after that, loadMovie with array from XML object or ("image"+(i+1)) inside it.
step 2&3 are inside init() function and before applying ReflectionFlipper.Could you show me a simple source on your Blog or ZIPPED file ?
- manu 2007-04-15 (日) 12:16
-
Thanks Tera,
here is the ZIP file
http://www.antille.fr/index.zipThanks again for your help
- manu 2007-04-15 (日) 14:02
-
With the fla (zip) can you show me a sample file?
- tera 2007-04-15 (日) 23:40
-
Sorry I meant I want to see your working file with extra JPG images.
I have no time to build by myself, so I want to see your work.
Regards. - manu 2007-04-16 (月) 01:33
-
Hi Tera,
Here is my project:
http://www.teledom.fr/coverslow/coverslow.zipI put image in folder "images" so I just want to load image in each mc. for exemple images/villa.jpg in my_mc1 and etc.
I try but without success.Thanks to take of your time to help me, I truly appreciate it.
- No Name 2007-04-17 (火) 23:44
-
Hi Tera,
I know you have lots of work, no problem I Find a solution for the external loading.
But I would want to make a new navigation with sliding bar (like in itunes) and I don't know how to do... can you help me jut for that?
Thank you very much tera....
- tera 2007-04-18 (水) 12:48
-
Hi.
I tried to attach "scrollbar" before, but I couldn't.
And tried external loading, but I couldn't too.
Sorry and please find a solution yourself.
Thank you. - manu 2007-04-19 (木) 04:12
-
ok tera, no problem...
and thanks again for your help.
Good work!
- Tomas 2007-04-19 (木) 10:56
-
Hi, very cool actionscript. I ve been trying to load external images dynamically with xml, but have been unsuccesfull. If someone knows how load them please mail me.
Thanks - tera 2007-04-19 (木) 11:20
-
Me too. I'm looking for someone to solve it.
Thank you. - manu 2007-04-20 (金) 23:10
-
Hi Tera,
I have an Idea for the scrollbar: It is not professionnal but it would work. What about doing a movieclip on the buttons and add Function with hitTest, I make a code but it doesn't working, (sorry but I begin in flash so...). Can you help me?
slider_mc.onPress = function () {
this.startDrag (false, 0, this._y, 480, this._y);
checkTarget(this);
};
slider_mc.onRelease = function () {
this.stopDrag ();
delete this.onEnterFrame;
};function checkTarget(drag) {
if (drag.hitTest(this["btn"+b])) {for(b=1;b this["btn"+b].index=b
this["btn"+b].onRollOver=function(){
home.sequenceFlg = true;
if(home["mc_"+(this.index-1)]._alpha==100){
sequenceSlide(home["mc_"+(this.index-1)]);
}else{
sequenceSlide(home["mc_"+(this.index+7-1)]);
}
}
}
}
}
- tera 2007-04-20 (金) 23:35
-
Thank you for your idea, but it's too partial for me to understand.
I think it's too tough way to add and collaborate with scrollbar without no contradiction. So I will not refine this CoverSlow anymore.
Please keep trying as you like, but I can't help any more.
Thank you. - Tomas 2007-04-24 (火) 13:47
-
Hi again,
I' m working in a gallery using a modified DistortImage Class of Andre Michelle to load External images and a MovieClip.Prototype to create the Perspective effect. Maybe you could transform your actionscript and integrate it with my source Code to load external images in your CoverSlow proyect. The code is very simple as it uses a SetInterval function to track image's position and transform it depending on the position on the stage. Here is the DistortImage Class and the fla. Hope it helps,
gallery: http://www.tomatria.com/albumflow
download: http://www.tomatria.com/albumflow/albumflow.zipAnd please send me the source code if it works.
Thanks.
- Tomas 2007-04-25 (水) 00:43
-
Hi, I forgot to menction the source code is for flash 7 because i m working in a wii music player as well
- tera 2007-05-06 (日) 23:39
-
Hi everyone.
I found the article below:
"First Papervision Experiment - Coverflow"
http://www.richapps.de/?p=54
very cool CoverFlow with slidebar. - Cian 2007-05-23 (水) 09:40
-
HI
I'm doing my first piece of work using the fantastic coverflow. However I'm running into some problems. I need to make all the images appear bigger. However I can only seem to get the centre pic to appear bigger or smaller by modifying the following line:var scaleVal:Number = 160;
Can anyone tell me how I get the other images to the left and right to scale up also in proportionate size? Many thanks. Any help would be greatly appreciated.
- reuelka 2007-06-20 (水) 21:24
-
hi there i think its amazing how everyone is comunicating from diffrent places and languges
im just starting out with flash design and came a cross your cover flow i was just wondering if you could explain to me as how to make it work i tried test movie and nothing
i know this must seem like a really stupid question but id really would like to learn
thanks - Kayla 2007-09-23 (日) 03:28
-
Hello Tera..
Glad to see you and your work...
I have problem to use this Flash cover Flow..
I have test the movie and found error :DistortImage.as, Line 238 public var points:Array; The same member name may not be repeated more than once.
var f:Fuse = new Fuse(); The class or interface 'Fuse' could not be loaded.
Any solution for this?
Thank you for your help =]Regard,
Kayla - tera 2007-09-23 (日) 07:49
-
Hello Kayla.
1: Line 238 error.
Please see the article "http://theflashblog.com/?p=224" comment 6&7.2: 'Fuse' could not be loaded.
Do you have a "Fuse Kit (http://www.mosessupposes.com/Fuse/)"?
I use and call FuseKit in my sample, but I don't include it.
Please download the Kit, and put the "com" folder in the same directory with my .fla file.
- Kayla 2007-09-26 (水) 03:13
-
Thank you very muachhh Tera ^^
Now I understand..
Fuse is very nice component ^^Thanks ^^
- Christine 2007-11-17 (土) 07:54
-
This is terrific but I cannot get the .fla to load my sandy.util.distortimage class. I get an error that the distortimage class that was imported is not the one that is being compiled. Where did you get your distortimage class and what version is it?
- tera 2007-11-17 (土) 10:13
-
Hi Christine
My download file doesn't contain Sandy package, so you can download it from "http://www.flashsandy.org/download".
And my .fla was made with AS2, so please download AS2 version. I forget what version I used. Maybe 1.2, or later...And if you will get "Line 238 error" with Sandy. Please read upper comments in this article.
Thank you.
- Tokidaze 2008-02-25 (月) 18:41
-
Hi! I love your work
I would like to know that how to add comment below each picture when it come to the center just like i-Tune does.
thx plz help^_^ - tera 2008-02-25 (月) 19:05
-
Hello, Tokidaza.
I'm glad to see you!
Sorry, I will busy another work until 3/25, so I can't afford to make a sample.
Please check the "for-loop" to generate a picture-unit movieclips and add a "createTextField" there.
regards. - Tokidaze 2008-02-27 (水) 11:48
-
Hi Tera thx for your reply ^_^
could you kindly tell me which line I should put the "createTextField" code? I can't find the "for-loop" thing that you mentioned about. - tera 2008-02-27 (水) 12:44
-
Hi Tokidaze
Easy way is:
1: Create Dynamic TextField on the "_root timeline" using Flash IDE. And name the instans name "albumName" for example.
2: In _root's framescript, line 62(inside "mc.onPress"), write "_root.albumName.text = "album name here!"; ". You can see the text changed when you click the mc.
3: Try customize "album name here!" part with Array or Xml or something dynamic data.sorry for my poor english.
- Tokidaze 2008-04-09 (水) 16:41
-
Hi Tera now I already figured already how to put the comment to correspond each picture here is the Flash that I made base from your Cover Slow ^_^
www.anpac.jp - tera 2008-04-09 (水) 17:11
-
Congraturations Tokidaze! I'm happy too.
I'm surprized that you have made a japanese site!
Good work ^_^
Trackback:0
- TrackBack URL for this entry
- http://www.trick7.com/blog/mt-tb.cgi/466
- Listed below are links to weblogs that reference
- Flash で cover flow 表現 from trick7.com blog




