프로그래밍/Flex/AIR2009.11.10 13:42
다음블로그 기본 사이드바가 166이다 보니 다른 블로그들에 넣을 때 너비가 좀 안 맞죠!?

아래 스크린샷처럼
관리 > 스킨 > 사이드바 설정 >사이드바 꾸미기 > 위젯 편집 클릭하시고
width=166으로 된 부분의 숫자를 200으로 수정하시고 확인을 누르시면 됩니다. ^^

저작자 표시 비영리 변경 금지
신고
Posted by 시난
프로그래밍/Flex/AIR2009.06.01 18:01

http://blog.jidolstar.com/530

지돌스타님이 [Adobe RIA 소식]Flash Builder 4 배포 글을 올리셨습니다.
역시 깔끔하게 잘 정리해주셨네요 ^^
참고하세요!

저작자 표시 비영리 변경 금지
신고
Posted by 시난
TAG FB, flex
프로그래밍/Flex/AIR2009.02.12 00:36
[Flex,AIR] SystemManager의 deployMouseShields() 함수 사용하기

WINAPI32의 SetCapture(hwnd); 처럼
마우스를 화면에 가두는 메소드에 대한 설명입니다.

지돌스타님이 포스팅하셨네요 >_<
정말 기막힌 타이밍입니다.
제가 오늘 이거 찾아보고 있었거든요 ㅎㅎ; 신기합니다

p.s. Flex SDK 3.2 에서 추가되었을 겁니다. 이하 버전은 업그레이드 하세요 ^^

저작자 표시 비영리 변경 금지
신고
Posted by 시난
프로그래밍/Flex/AIR2008.11.13 00:40
flex의 FileReference는 전송할 때
다음과 같이 모든 파일의 content-type을 application/octet-stream 으로 전송하기 때문에


 
POST /handler.asp HTTP/1.1
Accept: text/*
Content-Type: multipart/form-data;
boundary=----------Ij5ae0ae0KM7GI3KM7ei4cH2ei4gL6
User-Agent: Shockwave Flash
Host: www.mydomain.com
Content-Length: 421
Connection: Keep-Alive
Cache-Control: no-cache

------------Ij5ae0ae0KM7GI3KM7ei4cH2ei4gL6
Content-Disposition: form-data; name="Filename"

sushi.jpg
------------Ij5ae0ae0KM7GI3KM7ei4cH2ei4gL6
Content-Disposition: form-data; name="Filedata"; filename="sushi.jpg"
Content-Type: application/octet-stream

Test File
------------Ij5ae0ae0KM7GI3KM7ei4cH2ei4gL6
Content-Disposition: form-data; name="Upload"

Submit Query
------------Ij5ae0ae0KM7GI3KM7ei4cH2ei4gL6
(actual file data,,,)



content_type => :image을 쓸 수 없다.
쓴다면 'Content type is not included in the list'  이라는 에러 메시지를 볼 수 있다.
class Photo < ActiveRecord::Base
  has_attachment :storage => :file_system,
                 :max_size => 300.kilobytes,
                 :resize_to => '320x200>',
                 :thumbnails => { :thumb => '100x100>' }
                 #:content_type => :image                
  validates_as_attachment

end



저작자 표시
신고
Posted by 시난
프로그래밍/Flex/AIR2008.10.29 01:10
출처: http://homepage.mac.com/nobutoshik/iblog/C1940446103/E20080313205109/index.html


Tips

Implementing row and column styling in the AdvancedDataGrid control

ColdFusion Grid Editing Basic

Realistic 3D War Zone

2 new tutorials about WOW integration with Sandy

AS2Dac

Difficulties with Papervision 3D when embed width and height in html are 100%

Life buoy

Papervision3D Shaders / Bumpmap example sourcecode for CS3

Programmatic drawing Silverlight 2 part 3

Hobnox AudioTool Guide Tour

look ma, no thumbs

Copy a Directory Using CFZIP

Flex 3 Chearsheet, MXML controls

Create a cool futuristic website interface

OpenFlux Example

Fractals in AS3

AsDoc with Flex Library Project

How to apply chart license to Flex 3

Learning Flex From Scratch

Flex 3 DataGrid Footers

PicLens

Polar Distort class

SpringTiles

Modding flying cars in Aviary

Setting the border alpha on a Panel container in Flex

Using a CheckBox to filter items in a DataGrid in Flex

Dynamically generating PowerPoint presentations in ColdFusion

Setting the background alpha on a Panel container in Flex

Creating OLAPCube in AS

4 Tricks for using MovieClips as Buttons

AS3 Fire Effect Class

AS3 Flash Video Player Example

Flex Memory Optimizations
저작자 표시
신고
Posted by 시난
TAG flex
프로그래밍/Flex/AIR2008.10.22 10:25
1. Flash Player 9의 보안 변경 사항

2. Flash개발자는 필독! Flash Player 9의 Security정책 변경

3. Flash Player10 보안샌드박스


저작자 표시
신고
Posted by 시난
프로그래밍/Flex/AIR2008.09.23 10:13
Source:
http://blog.computerelibol.com/?p=3


Recently, I used papervision for a project. I needed to create a carousel like 3D system. Even though I think it would be helpful and interesting to some to write about the carousel, I’m going to focus on the equations this task led me to instead. I think they’ll prove to be very useful to anyone that needs to match design compositions with pixel perfect precision. To really get the most out of this article, you’ll need some papervision experience. Having made a carousel will help too :) At the moment, I’m unable to share any working example of the carousel, but at some point I should be able to post an example.

[Update 08/22/2008: The equations in this article and in the source will only work for builds prior to 639. I am in the process of writing an article about a set of functions that should achieve these effects for versions of papervision after 639. I am leaving this article intact for educational purposes.]

[Update 08/15/2008: sample source - it is not the carousel, but it demonstrates the use of the equations pretty well.]

Carousel Explained
Think of a carousel as having the interactive properties of an ordinary list component. The way this (and probably all) carousels work is by displaying a collection of selectable items on the screen. Only one item is selectable at a time. The selected item is visually distinguishable in some way (highlighted, repositioned, etc.) In our carousel, the selected item is distinguished by repositioning it to the center of the collection of items. The items to the left and to the right of the selected item are rotated slightly, and moved down the z axis to create the contrast needed between selected and deselected items. With papervision, the display object for each item is typically a Plane, but anything can be used.

Scaling: Problem
The problem started out with having the selected plane object to display at the scale of the design composition I was given. Usually, the projects we do don’t have any 3D UI. Consequently, we have no process for exporting Collada, since the medium the composition is designed in cannot actually produce such a format (Please let me know if there is a way to export Collada from After Effects.) Consequently, I was left to replicate the composition by measuring 3D data on a 2D plane.

Scaling: Solution
I soon came to realize that I essentially needed to be able to negate perspective (later this becomes even more critical since I need to apply perspective to 2D measurements, and negate perspective from 3D measurements), but I wasn’t exactly sure about how to do this. I started by trying different constants on the cameras zoom and focus properties, I kept the object Z at 100, and camera focus at default (100) because this obviously had a lot to do with whether the object was at the intended scale. I did find some constants that gave me the results I was looking for, but at a Z position of 100, I was getting hardcore perspective distortion.

After some revisions, I checked out the papervision source and came across the equation for computing perspective. It looks like this:

perspective = focus*zoom/(focus+screenZ)

screenZ is the distance between said DisplayObject3D from the camera on the z axis, focus and zoom are properties of the camera, or in other words, our perspective of the object. Given that the object and camera both have zero rotation, or, possibly a right angle or 180 depending on the object type, modifying any one of focus, zoom, or screenZ(which can be computed, -cam.z + targetZ or just object.screen.z if the object is already in position) to a certain value always produced a pixel perfect match to the composition. After spacing out into a series of day dreams, and some trial and error, I came up with equations that will solve for any of the variables, which when set, will produce the correct distance between the camera and an object to display it at a scale that matches a regular DisplayObject as it would be if you were to simply add it to the stage, that is, as opposed to making it the material of a Plane, and possibly other display types.

Scaling: Equations

//Solve for cam.zoom
cam.zoom = (cam.focus + item.screen.z) / cam.focus;
 
//Solve for cam.focus
cam.focus = item.screen.z / (cam.zoom * (1-1/cam.zoom));
 
//Solve for screenZ
screenZ = cam.focus*cam.zoom-cam.focus;
//Or
screenZ = -cam.z + targetZ;
 
//This is obviously pointless when you have a reference to item.screen.z, but useful if you're
//precomputing before a transition. negate perspective from screenX/screenY
var negatePersp:Number = 1/(cam.focus*cam.zoom/(cam.focus + item.screen.z));

Positioning: Problem
Being able to get the position that a 2D coordinate should have on the x/z plane or the y/z plane was also necessary. I needed to evenly distribute unselected objects over the left and the right areas of the selected object.

Positioning: Solution
We need a way to compute the x position that a plane should have based on a limited amount of screen real estate on the x axis at some variable z position. We will need some predefined variables. item is the Plane we’re computing the x position for, cam is our Camera3D, and xArea is the area we have to display objects on the left or right side of the selected object. Note that in the actual carousel, I only compute these values once, and use them as needed during transitions. The main difference is that a predefined z position is used to compute screenZ, which would take the place of item.screen.z.

Positioning: Equations

//Compute the perspective
var persp:Number = cam.focus*cam.zoom/(cam.focus + item.screen.z);
 
//Compute half of the width of the item at item.screen.z,
//we need this value because the registration point of 3D display objects are at their center,
//and we don't want objects falling outside of xArea
var perspItemWidth:Number = item.width/2*persp;
 
//The following operation gives us a value which will produce the inverse ratio of persp
var negatePersp:Number = 1/persp;
 
//First subtract item.width,
//which we've computed perspective for at item.screen.z from xArea,
//then apply the inverse operation of perspective on xArea,
//we should think of xArea as if it were the screen.x of an object at item.sceen.z
var negatedXArea:Number = (xArea-perspItemWidth)*negatedPersp;

Inverse Ratio of Perspective Explained
Let’s say xArea is a 2D object at 0,0 with a width of 100. It’s taking up 100 pixels on the screen on the x axis. If we want to evenly distribute objects across this area at a z position of 1300, we can’t just use the width of xArea to compute the distribution. Let’s say we magically add a z property to xArea, and we send it to z position 1300. Now that it’s further away, it doesn’t take up as much space as it did when it was right in our face, so it doesn’t take up the 100 pixels of screen space that we need it to. What we do is compute the perspective to apply to an object at such a distance, and then we divide 1 by the perspective to get the inverse ratio of the perspective. We then multiply our new ratio by the width of xArea (100.) This gives us the distribution scale we need (127) in order to use a screen pixel width of 100 (as opposed to 78) at z position 1300. We can say that we need to distribute objects across 127 “papervision 3D units” in order to distribute them evenly across 100 screen pixels at a z position of 1300.


신고
Posted by 시난
프로그래밍/Flex/AIR2008.09.23 09:47
source:
http://www.barbarayersin.com/2008/04/how-to-display-text-in-papervision.html


I've been looking for a tutorial to display a simple text field within papervision without much success. I finally tumbled on this blog post where it was quite well explained. The example however might be a little long to demonstrate my sole purpose: how to display text in papervision.

So I've decided to put here an even simpler example to make things crystal clear:


// create your text field and set its content.
var t:TextField = new TextField();
t.text = "Hello world!";
// create a BitmapData of your wished width and height
var bitmap:BitmapData = new BitmapData(100,100);
// Fill bmp with the content of your TextField.
//It's as if you took a picture of t.

bitmap.draw(t);
// Create a material with the resulting BitmapData and you can use it on any DisplayObject3D!
var material:BitmapMaterial = new BitmapMaterial(bitmap);
material.smooth = true;
material.doubleSided = true;
var p:Plane = new Plane(material,100,100);
scene.addChild(p);


First observation is that it seems impossible to directly embed a UIComponent within papervision *sigh*. Whatever the UIComponent (Button, TextField, etc), it has to be put somehow in a texture and applied on a DisplayObject3D such as a Plane.

Or at least, I have no knowledge of another way to do it. Does anybody know better? My worry is that it may slow down the frame rate to display text in a texture rather than directly as what it really is: good old plain text.
신고
Posted by 시난
프로그래밍/Flex/AIR2008.09.23 09:41
source:
http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d

I have been banging my head against a wall with a simple Papervision3D problem: making a normal Flash 2D object (a DisplayObject, or Sprite) to appear at the same coordinates as a 3D object (a DisplayObject3D, or Plane, or whatever).

After spending the best part of a day scouring mailing lists, I found this method that solved the problem:

public function convertTo2DCoords(o:DisplayObject3D, camera:CameraObject3D, offsetX:Number = 0, offsetY:Number = 0):Point {
var view:Matrix3D = o.view;
var persp:Number = (camera.focus * camera.zoom) / (camera.focus + view.n34);
return new Point((view.n14 * persp) + offsetX, (view.n24 * persp) + offsetY);
}

You just need to add half the Stage.width to point.x, and half the Stage.height to point.y, and Bob’s your uncle …

(I was working with a 3D scene that filled the whole stage … might need some tweaking if this is not the case …)

I am posting this because, although it’s apparently a quite basic Papervision problem, it took ages to find it. We need better PV3D documentation!





신고
Posted by 시난
프로그래밍/Flex/AIR2008.09.23 00:37
PicLens처럼 꾸며보기..
조금 다르지만 ^^;


데모:
http://lostsin.cafe24.com/flex/book_search/

300k 정도네..
모듈화 해야겠지...



신고
Posted by 시난