Hatena::Groupactionscript

ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記

2009年03月27日 金曜日

お試し期間終了

| 22:39 | お試し期間終了 - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 を含むブックマーク はてなブックマーク - お試し期間終了 - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 お試し期間終了 - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 のブックマークコメント

やはり買おうかなあ、と思うけれどダウンロード版を買うよりも、Amazonでパッケージ版を買った方が安いというのは、どうしたものか。Version.4がすぐに出そうな気もするし。

Adobe Flex Builder Standard 3.0 日本語版 Windows/Macintosh版

Adobe Flex Builder Standard 3.0 日本語版 Windows/Macintosh版

買うなら早い方がいいんだろうなあ。

というわけで、悩み中。

SakuraSakura2015/09/30 16:36That's a shrewd answer to a tricky queotisn

HugoHugo2015/10/09 07:35<a href="http://uutheb.com">Entglhiening</a> the world, one helpful article at a time.

WendelWendel2015/10/09 11:59Whoa, whoa, get out the way with that good inoaimftron. http://qkdqidrnbrl.com [url=http://jynwztyht.com]jynwztyht[/url] [link=http://slexuoboi.com]slexuoboi[/link]

BrandilynBrandilyn2015/10/10 06:42Boy that <a href="http://nzrqbxj.com">relaly</a> helps me the heck out.

PepePepe2015/10/12 07:12If you wrote an article about life we'd all reach ennlnhtegmeit. http://fbhznrkj.com [url=http://mmgeiizp.com]mmgeiizp[/url] [link=http://sgvqrbc.com]sgvqrbc[/link]

ThabypeThabype2018/02/17 13:10Where To Buy Dutasteride 0.5mg Website Miglior Sito Dove Comprare Viagra Generic Tab Acticin In Usa Visa Accepted <a href=http://cheapciali.com>cialis</a> Priligy Update Viagra Kaufen Gunstig

BrceBrewsBrceBrews2018/04/17 19:05wow look it cialis mexico american pharmacy cialis
<a href="http://kaivanrosendaal.com/#Buy-Cheap-Cialis-Online">Buy Cheap Cialis in usa</a> overnight cialis tadalafil price cialis per pill

BrceBrewsBrceBrews2018/04/18 13:18can i take cialis and ecstasy generic cialis pro
<a href="http://kaivanrosendaal.com/#Cialis-Cheap-Buy-Online">buy cialis</a> how much does a cialis cost canadian drugs generic cialis

HrafdceBrewsHrafdceBrews2018/04/19 05:44shop for cialis cheap order cialis at a discount pillule cialis photo <a href=http://jvrimages.com/#cialis+tadalafil>callus</a> only here cialis sale cheapest cialis tablet uk orden de cialis barata
<a href=http://jvrimages.com/#cialis+30+day+trial+coupon>when will cialis become generic</a> buy cialis karachi pakistan fgr 100 generic cialis review simile al cialis
http://jvrimages.com/#cialis+dosage+recommendations order by phone cheap cialis is cialis generic now visit web site homemade cialis

HrafdceBrewsHrafdceBrews2018/04/19 18:32otc cialis in uk info cialis pfizer workshops cialis <a href=http://jvrimages.com/#cialis+coupons+printable>discount cialis</a> cialis for sale uk cheap cheap cialis from the usa buy real cialis online usa
<a href=http://jvrimages.com/#generic+cialis>cialis dosage</a> buy 1 cialis pill at a time cialis en espanol teilbar cialis cialis levitra
http://jvrimages.com/#cialis.com cialis buy online get buy genuine cialis cialis plus stay hard

HrafdceBrewsHrafdceBrews2018/04/20 09:08cialis soft generico generic cialis prices buy cialis generics nl <a href=http://jvrimages.com/#warnings+for+cialis>cialis for daily use</a> cialis und alkohol only for you cheaper cialis cialis nitric oxide
<a href=http://jvrimages.com/#canadian+cialis>cialis canada</a> cialis maximum dose daily we use it cialis health store cialis e farmaci simil
http://jvrimages.com/#side+effects+for+cialis i want to order cialis order cialis at a discount venta cialis por internet

HrafdceBrewsHrafdceBrews2018/04/21 02:43cialis online chennai brand cialis wholesale cialis sales wa
<a href="http://jvrimages.com/">buy cialic</a> cialis or cialis prices cialis achat de toronto the best place cialis buy now
cialis online vergleich cialis canada achat cialis c 200 dealy ejaculation
http://jvrimages.com/#calluses+on+feet en vente cialis cialis y dolor de cabez venta cialis por internet

EllExcabsEllExcabs2018/04/21 13:50Discount Programs For Accutane Viagra Eyaculacion <a href=http://cialibuy.com>buy cialis online</a> Indomethacin Online Order No Rx Usa Vademecum Cialis Cialis Zuzahlung

KufdrgeSaxKufdrgeSax2018/05/02 15:41we recommend cialis info generic cialis levitra <a href=http://foreigncircles.com/#trazodone-tablet>Trazodone cheap</a>
acheter du cialis a geneve we use it 50 mg cialis dose
<a href=http://foreigncircles.com/#buy-Trazodone-cheap>trazodone tablet</a>
http://foreigncircles.com

KufdrgeSaxKufdrgeSax2018/05/02 18:48cialis australia org acquisto online cialis <a href=http://foreigncircles.com/#buy-Trazodone>trazodone tablet</a>
cialis mit grapefruitsaft recommended site cialis kanada
<a href="http://foreigncircles.com/">buy trazodone tablet</a>
http://foreigncircles.com

RehgeSaxRehgeSax2018/05/18 06:38<a href="http://humblegaiwan.com/">buy sildenafil for cheap</a> venta viagra en espaa buy online viagra 5mg
viagra sale online prices on viagra 10 mg <a href="http://humblegaiwan.com/">buy sildenafil cheap sildenafil order sildenafil</a>
acheter viagra meilleur pri viagra usa cost
buy viagra cheap 10 mg viagra sale online <a href=http://humblegaiwan.com/>buy cheap sildenafil sildenafil sildenafil</a>
if a woman takes a mans viagra brand viagra nl
http://jardinstea.com/#100mg

RehgeSaxRehgeSax2018/05/18 08:05<a href="http://humblegaiwan.com/">buy sildenafil online cheap</a> rx viagra para comprar viagra soft tabs for sale
buy cheap viagra in uk viagra therapie <a href="http://humblegaiwan.com/">buy cheap sildenafil tablets</a>
prescription doctor viagra we recommend viagra info
viagra 10 doctissimo order viagra from india <a href=http://humblegaiwan.com/>buy sildenafil cheap fed ex</a>
best generic drugs viagra enter site natural viagra
http://humblegaiwan.com/

RehgeSaxRehgeSax2018/05/18 09:20<a href="http://jardinstea.com/">sildenafil 100 mg for sale</a> recommended site viagra kanada online prescriptions viagra
buying brand viagra online we use it viagra online store <a href="http://jardinstea.com/">sildenafil citrate 100 mg pills</a>
generic viagra pill online viagra farmacias guadalajara
we like it viagra price venta de viagra canada <a href=http://humblegaiwan.com/>sildenafil buy cheap</a>
trusted tabled viagra softabs female viagra no prescription
http://humblegaiwan.com/

RehgeSaxRehgeSax2018/05/18 10:29<a href="http://humblegaiwan.com/">buy cheapest sildenafil</a> buying viagra on internet we choice free trial of viagra
i recommend viagra generico generic viagra pill online <a href="http://humblegaiwan.com/">buy cheap phentermine moreover order sildenafil</a>
we choice viagra uk prezzo viagra a buon mercato
viagra 100 mg 30 tablet viagra 100 mg 30 tablet <a href=http://jardinstea.com/#sildenafil-citrate>sildenafil 100 mg coupons</a>
recommended site viagra kanada import viagra
http://jardinstea.com/

RehgeSaxRehgeSax2018/05/18 11:44<a href="http://humblegaiwan.com/">buy female sildenafil online cheap</a> order generic viagra online prezzo viagra a buon mercato
prix de viagra we like it viagra price <a href="http://jardinstea.com/#100mg">sildenafil citrate generic viagra 100mg</a>
viagra prezzo di mercato prezzo di viagra in bulgaria
viagra price in bangalore chinese viagra 50 mg <a href=http://jardinstea.com/#100mg>sildenafil 100 mg tablets</a>
where cheapest viagra viagra daily reviews
http://jardinstea.com/#100mg

RehgeSaxRehgeSax2018/05/18 12:59<a href="http://humblegaiwan.com/">buy cheap brand sildenafil online</a> try it no rx viagra chinese viagra 50 mg
viagra pas cher paris viagra 5 mg schweiz <a href="http://humblegaiwan.com/">buy cheap sildenafil from india</a>
generic viagra 20mg uk generic viagra 20mg tablets
we use it 50 mg viagra dose prix viagra once a da <a href=http://humblegaiwan.com/>buy sildenafil for cheaper prices</a>
precios de viagra generico buy name brand viagra on line
http://jardinstea.com/#buy-100-mg

RehgeSaxRehgeSax2018/05/18 14:06<a href="http://humblegaiwan.com/">buy sildenafil pills for cheap</a> viagra taglich ou trouver viagra sur le net
when can i take another viagra il viagra quanto costa <a href="http://humblegaiwan.com/">cheap place to buy sildenafil</a>
we use it 50 mg viagra dose viagra 20mg preis cf
viagra generico postepay buy online viagra 5mg <a href=http://jardinstea.com/#buy-100-mg>sildenafil citrate 100 mg pills</a>
buy viagra online cheapest we choice free trial of viagra
http://jardinstea.com/#100mg

RehgeSaxRehgeSax2018/05/18 15:18<a href="http://humblegaiwan.com/">cheapest way to buy sildenafil 38</a> look here viagra cheap canada tarif viagra france
generico viagra mexico viagra 20mg preis cf <a href="http://humblegaiwan.com/">buy real sildenafil cheap</a>
buying viagra on internet free generic viagra
viagra generic tadalafil buy viagra canadian drugs <a href=http://humblegaiwan.com/>buy cheapest generic sildenafil online</a>
viagra farmacias guadalajara enter site 20 mg viagra cost
http://jardinstea.com/#sildenafil-citrate

RehgeSaxRehgeSax2018/05/18 16:33<a href="http://humblegaiwan.com/">buy real sildenafil for cheap</a> viagra herbs can i take viagra and ecstasy
viagra 20 mg effectiveness how do viagra pills work <a href="http://humblegaiwan.com/">buy cheap sildenafil 32</a>
venta viagra en espaa trusted tabled viagra softabs
we recommend viagra best buy link for you viagra price <a href=http://humblegaiwan.com/>buy cheap sildenafil online</a>
generic viagra at the pharmacy we choice free trial of viagra
http://humblegaiwan.com/

RehgeSaxRehgeSax2018/05/18 18:14<a href="http://humblegaiwan.com/">buy sildenafil online cheapest</a> viagra e hiv prix viagra once a da
purchase once a day viagra viagra prezzo in linea basso <a href="http://humblegaiwan.com/">buy cheap generic sildenafil</a>
cost of viagra cvs viagra farmacias guadalajara
buy cheap viagra in uk online prescriptions viagra <a href=http://humblegaiwan.com/>buy cheap sildenafil</a>
deutschland viagra online viagra prezzo in linea basso
http://jardinstea.com/#buy-100-mg

RehgeSaxRehgeSax2018/05/18 19:55<a href="http://jardinstea.com/#100mg">Buy Sildenafil Citrate 100 mg</a> prix de viagra order generic viagra online
viagra per paypa viagra 5 mg scheda tecnica <a href="http://jardinstea.com/#buy-sildenafil">sildenafil 100 mg</a>
ou trouver viagra sur le net viagra rezeptfrei sterreich
mycanadyanpharmacyviagra bulk viagra <a href=http://humblegaiwan.com/>buy sildenafil online cheap with no prescription</a>
online prescriptions viagra viagra authentique suisse
http://jardinstea.com/#sildenafil

RehgeSaxRehgeSax2018/05/18 21:33<a href="http://jardinstea.com/#100mg">sildenafil citrate 100mg coupons</a> prices for viagra 50mg india viagra 100mg cost
purchase once a day viagra ou trouver viagra sur le net <a href="http://humblegaiwan.com/">buy generic sildenafil online cheap</a>
viagra pills boards viagra australia org
viagra taglich viagra wir preise <a href=http://humblegaiwan.com/>buy brand sildenafil cheap</a>
acquisto online viagra viagra 10mg prix pharmaci
http://jardinstea.com/#buy-sildenafil

Get More InformationGet More Information2019/01/05 02:27Work is the greatest thing in the world, so we should always save some for tomorrow.

#SORRYME#PLS#

cialis genericcialis generic2019/01/06 00:11I think, that you are mistaken. Write to me in PM, we will discuss.

<a href=http://cialisedshop.com/>cheap cialis</a>
<a href=http://cialisedshop.com/>buy generic cialis</a>
<a href=http://cialisedshop.com/>cialis pharmacy</a>
<a href=http://cialisedshop.com/>cialis online</a>

WilliamPievyWilliamPievy2019/02/02 09:57cialis prodaja beograd
cialis cheapest lowest price usa
<a href=https://greatwinesgrandhouses.com>Cheap cialis buy online</a>
cialis tablete u bih
cialis delivery canada
https://kellyannehulme.com
cialis nei sexi shop
cialis nhs price
<a href=https://greatwinesgrandhouses.com>buy Cheap cialis</a>
medco generic cialis
canada cialis online pharmacy
https://kellyannehulme.com

WilliamPievyWilliamPievy2019/02/02 09:57cheap cialis 5mg
kaiser pharmacy price for cialis
<a href=https://kellyannehulme.com>Cheap cialis buy online</a>
mejor farmacia online cialis
cialis online free shipping
https://kellyannehulme.com
non prescription cialis online
cialis kaufen 10mg
<a href=https://kellyannehulme.com>20 mg cialis</a>
cialis for bph cost
cialis online denmark
https://greatwinesgrandhouses.com

ArnoldmargoArnoldmargo2019/02/05 18:03generic cialis 60mg
cialis 5 mg order on line
<a href="http://cialistlm.com">buy cialis</a>
canadian brand label cialis
acheter cialis
<a href="http://cialistlm.com">buy cialis</a>
super facialist vitamin c+ skin defence daily moisturiser review
buy generic cialis generic cialis
<a href="http://cialistlm.com">Buy Cialis Online</a>

ArnoldmargoArnoldmargo2019/02/05 18:03buy cialis switzerland
i would like to purchase cialis
<a href="http://xcialisxx.com">Cheap Cialis</a>
order cialis overnight
buy cialis with echeck
<a href="http://cialistlm.com">Buy Cialis Online</a>
generic cialis 10mg reviews
acheter_cialis_generique_10
<a href="http://cialistlm.com">Buy Cheap Cialis</a>

2009年03月25日 水曜日

はてなフォトライフの画像を表示してみる(7)

| 06:13 | はてなフォトライフの画像を表示してみる(7) - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 を含むブックマーク はてなブックマーク - はてなフォトライフの画像を表示してみる(7) - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 はてなフォトライフの画像を表示してみる(7) - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 のブックマークコメント

一応、動きますが、やはり色々と不満が出てきています。ソースも全部貼ってみました。

問題

  • 1度読み込んだ画像は使い回したい
    • 何回も読み込みをしてしまう
    • サムネール画像を表示している間に、大きい画像を読み込んでおきたい
  • ちょっとした図形を用意するのが大変
    • たぶん馴れの問題なんだと思うけれど、三角形を右に45度回したいとか、一つ一つ調べる必要がある
  • 画面サイズの取得
    • stage.stageWidthとは...
    • サイズに関することにはぼんやりとした状態になりやすい
  • Alertのような全画面をぼんやりとさせる
    • filterがあるらしい
    • bitmapについて調整する機能があるらしい

サンプル画像

f:id:d4-1977:20090325061612p:image

fhatena.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="*" layout="absolute" backgroundColor="0x000000">
	<comp:FhatenaViewer></comp:FhatenaViewer>
</mx:Application>

FhatenaViewer.as

package
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.events.*;
	import flash.net.*;
	import mx.core.UIComponent;
	import photo.Photo;
	import photo.PhotoInfomation;

	public class FhatenaViewer extends UIComponent
	{
		public var rdf:Namespace    = new Namespace("rdf",    "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
		public var dc:Namespace     = new Namespace("dc",     "http://purl.org/dc/elements/1.1/");
		public var hatena:Namespace = new Namespace("hatena", "http://www.hatena.ne.jp/info/xmlns#");
		public var canvas:Sprite    = new Sprite();

		public function FhatenaViewer()
		{
			createPhoto('http://f.hatena.ne.jp/d4-1977/rss');
		}

		public function createPhoto(feed:String):void
		{
			var loader:URLLoader = new URLLoader();
			loader.load(new URLRequest(feed));
			loader.addEventListener(Event.COMPLETE, createPhotoByXML);
			loader.addEventListener(ProgressEvent.PROGRESS, onLoading);
		}

		public function onLoading(event:ProgressEvent):void{}

		public function createPhotoByXML(event:Event):void
		{
			stage.stageFocusRect = false;
			var feed:XML = new XML(event.target.data);
			for each(var item:Object in feed.*::item){
				createPhotoItem(item.hatena::imageurlmedium,item);
			}
		}

		public function createPhotoItem(url:String,item:Object):void
		{
				var p:Photo = new Photo();
				p.property = item;
				p.x = (stage.width - p.width) * Math.random();
				p.y = (stage.height - p.height) * Math.random();
				addChild(p);
				p.loadImage(url);
				p.addEventListener(FocusEvent.FOCUS_IN,pFocusInHandler);
		}

		private function pFocusInHandler(event:FocusEvent):void
		{
			setChildIndex(event.currentTarget as DisplayObject, numChildren - 1);

			canvas.name = 'FhatenaViewer';
			addChild(canvas);
			setChildIndex(canvas, numChildren - 1);

			var p:PhotoInfomation = new PhotoInfomation();
			p.property = event.currentTarget.property;

			if(canvas.numChildren){
				canvas.removeChildAt(0);
			}

			canvas.addChild(p);
			p.loadImage(event.currentTarget.property.hatena::imageurl);
		}
	}
}

photo/Photo.as

package photo
{
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.net.URLRequest;
	
	public class Photo extends Sprite
	{
		public var property:Object;
		
		public function Photo()
		{
		}
		
		public function loadImage(url:String):void
		{
			var loader:Loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadhandler);
			loader.load(new URLRequest(url));
		}

		public function loadhandler(event:Event):void
		{
			addChild(event.target.loader);
			rotation = Math.random() * 30 - 10;
			addEventListener(MouseEvent.MOUSE_DOWN,mouseDownHandler);
		}

		private function mouseDownHandler(event:MouseEvent):void
		{
			stage.focus = this;
		}
	}
}

photo/PhotoInfomation.as

package photo
{
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.events.ProgressEvent;
	import flash.net.URLRequest;
	import flash.text.*;
	
	public class PhotoInfomation extends Sprite
	{
		public var property:Object;
		public var photoImage:Sprite = new Sprite;
		public var infomationBox:Sprite = new Sprite;
		public var hatena:Namespace = new Namespace("hatena", "http://www.hatena.ne.jp/info/xmlns#");

		public function PhotoInfomation()
		{
		}

		public function loadImage(url:String):void
		{
			var loader:Loader = new Loader();
			loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loading);
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadhandler);    // 読み込み
			loader.load(new URLRequest(url));
		}

		public function loading(event:Event):void
		{
		}

		public function loadhandler(event:Event):void
		{
			// サイズ指定
			if((stage.stageWidth < event.target.loader.width) || (stage.stageHeight < event.target.loader.height)){
				var per:Number;
				var perW:Number = stage.stageWidth / event.target.loader.width;
				var perH:Number = stage.stageHeight / event.target.loader.height;
				if(perW > perH){
					per = perH;
				}else{
					per = perW;
				}
				event.target.loader.width  = int(event.target.loader.width * per) -20;
				event.target.loader.height = int(event.target.loader.height * per) - 20;
			}

			// 写真
			addChild(event.target.loader);
			setUpInfomation();
			addEventListener(MouseEvent.CLICK, clickListener);
			addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
			addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);

			// 写真の位置
			this.x = int((stage.stageWidth - event.target.loader.width)/2);
			this.y = int((stage.stageHeight - event.target.loader.height)/2);
		}

		private function mouseOutHandler(event:Event):void
		{
			infomationBox.visible = false;			
		}

		private function mouseOverHandler(event:Event):void
		{
			infomationBox.visible = true;
		}

		private function setUpInfomation():void
		{
			// 文字列の場所
			infomationBox.graphics.beginFill(0x000000,0.5);
			infomationBox.graphics.drawRect(0, 0, this.parent.width, 50);
			infomationBox.graphics.endFill();
			// 文字列
			var text:TextField = new TextField();
			text.width     = this.parent.width;
			text.autoSize  = TextFieldAutoSize.RIGHT;
			text.htmlText  = '<font size="18" face="ヒラギノ角ゴ Pro W3"><b>' + property.*::title + '</b></font>';
			text.textColor = 0xffffff;
			infomationBox.addChild(text);
			//
			addChild(infomationBox);
			infomationBox.visible = false;
		}

		private function clickListener(event:Event):void
		{
			this.parent.removeChild(this);
		}
	}
}

CaioCaio2015/09/30 17:10something about the girl who had fallen from the roof... I got it! :DWell done! I hope to see fetuhrr updates on this. Maybe you can find some pictures for inside the cinema? That black color gave me the impression you couldn't see anything of the movie. :)Well done!

ArturoArturo2015/10/09 07:35Appreciate the kind comments. Have<a href="http://hfgzdxistr.com"> crutenrly</a> just submitted the sequel to the game company who is looking to publish it, so I suspect there will be updates in the next month or two.As for the pictures in the cinema... black is the color of imagination, eh? :-)

EesaEesa2015/10/09 11:59Hahaha! :DI'm really lniookg forward for the sequel (can't wait anymore, hehehe :) ). I can imagine that making a story like this is quite difficult and takes time. So I will have to wait, just as everyone else. Keep up the good work! http://sshroriwxmq.com [url=http://ewyekhvv.com]ewyekhvv[/url] [link=http://dwgrqvlj.com]dwgrqvlj[/link]

VloraVlora2015/10/10 06:42A perfect reply! Thanks for taking the <a href="http://qmvojs.com">trlueob.</a>

SamySamy2015/10/12 07:12Megali apogoiteusi o Kaklamanis .Isws h mreelutagi ever. Akoma ki o Abramopoulos kaluteros mou fainetai TOSO xalia ta exei paei o ..NikitasKi oxi mono gia thn x-mas periodo ,genikws. Osoi menoume se "kautes" perioxes ths a8inas (patissia ,kupseli, e3arxeia , pagrati kok) den exoume dei to paramikro na ginetai. Fwtismos xalia, skoupida pantou, pezodromia spasmena...Pou einai to prasino pou eta3e? Gia na mhn pw gia tis ...dwrean glastres meta tis fwties pou pote den dw8ikan. Den 8elw oute na ton akouw pia. Mas e3apatise oso kanenas dhmarxos. 8uammai tou ta exwne h Lifo alla molis phre dhmotiki diafhmisi stamatise ka8e kritiki.Wraioi dhmosiografoi ki autoi. Krima giati h A8ina mporei na einai polu pio omorfh. http://ugrbeyjtov.com [url=http://mbytwvdjwen.com]mbytwvdjwen[/url] [link=http://pluouiypq.com]pluouiypq[/link]

2009年03月23日 月曜日

stage.widthとstage.stageWidthでの違い

| 08:13 | stage.widthとstage.stageWidthでの違い - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 を含むブックマーク はてなブックマーク - stage.widthとstage.stageWidthでの違い - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 stage.widthとstage.stageWidthでの違い - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 のブックマークコメント

stage.widthとstage.stageWidthで取得できるサイズが違いました。

はまりました。

どうやら

  • ウィンドウの幅(stage.width)
  • 表示オブジェクトの幅(stage.stageWidth)

のようです。

これは、はまりやすいんじゃないかと、Adobeにいいたい

参考

2009年03月19日 木曜日

はてなフォトライフの画像を表示してみる(6)センター寄せ

| 22:16 | はてなフォトライフの画像を表示してみる(6)センター寄せ - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 を含むブックマーク はてなブックマーク - はてなフォトライフの画像を表示してみる(6)センター寄せ - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 はてなフォトライフの画像を表示してみる(6)センター寄せ - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 のブックマークコメント

センター寄せにしてみたけれど、なんだかずれるんですが...なぜ?

原因が分かった!

ソース(photo/PhotoInfomation.as)

package photo
{
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.net.URLRequest;
	import flash.text.*;
	
	public class PhotoInfomation extends Sprite
	{
		public var property:Object;
		public var photoImage:Sprite = new Sprite;
		public var infomationBox:Sprite = new Sprite;
		public var hatena:Namespace = new Namespace("hatena", "http://www.hatena.ne.jp/info/xmlns#");

		public function PhotoInfomation()
		{
		}

		public function loadImage(url:String):void
		{
			var loader:Loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadhandler);
			loader.load(new URLRequest(url));
		}

		public function loadhandler(event:Event):void
		{
			// 写真
			addChild(event.target.loader);
			addEventListener(MouseEvent.CLICK, clickListener);

			// 文字列の場所
			infomationBox.graphics.beginFill(0x000000,0.5);
			infomationBox.graphics.drawRect(0, 0, this.parent.width, 50);
			infomationBox.graphics.endFill();

			// 文字列
			var text:TextField = new TextField();
			text.width     = this.parent.width;
			text.autoSize  = TextFieldAutoSize.RIGHT;
			text.htmlText  = '<font size="18" face="ヒラギノ角ゴ Pro W3"><b>' + property.*::title + '</b></font>';
			text.textColor = 0xffffff;
			infomationBox.addChild(text);
			
			// 写真の位置
			this.x = (stage.width/2) - (this.parent.width/2);
			this.y = (stage.height/2) - (this.parent.height/2) - 20;
			addChild(infomationBox);
		}
		
		private function clickListener(event:Event):void
		{
			this.parent.removeChild(this);
		}
	}
}

2009年03月18日 水曜日

はてなフォトライフの画像を表示してみる(5)タイトルも一緒に表示

| 08:09 | はてなフォトライフの画像を表示してみる(5)タイトルも一緒に表示 - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 を含むブックマーク はてなブックマーク - はてなフォトライフの画像を表示してみる(5)タイトルも一緒に表示 - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 はてなフォトライフの画像を表示してみる(5)タイトルも一緒に表示 - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 のブックマークコメント

画像をクリックして、大きい画像を表示したり、画像のタイトルを表示することが出来ました。

でも、Flickrのスライドショーを見ていると不満な点も色々と出てきます。

他にも、fotologueもいいなあ(久々にfotologueを見たけれど)

こんなユーザー交流ページもあったんだ

課題

問題

  • XMLデータを色々なところに持っていくと
    • namespaceをclass毎に宣言する必要があるのが面倒
    • XMLデータの処理は一度にしたい
  • 大きい画像の読み込みが間に合わないことがある
    • エラーが発生します
    • loadingを用意した方がいい
    • 処理のタイミング
  • 文字サイズ
    • タイトルが長い場合、はみ出てしまう
  • 自分のフォトライフにいい写真がありません!

感想

  • だんだん面白くなってきた
  • 最初の画面設計が大切

実際

f:id:d4-1977:20090318080626p:image