Jan
31
PaperVision3D kinematiikkaa
Kategoria AS3, Flash & Flex, Flash 3D | 2 comments
Tämä Lee Felarcan tekemä demo kannattaa käydä testaamassa.
“A forward kinematics experiment using Papervision3D v2.0 alpha and a Collada 3D model of a robotic arm. Hope you enjoy it. I don’t want to release any source from this yet, as I want to do some more work on it, relating to the following items…”
Jan
31
Winter Wonder Land
Kategoria AS3, Flash & Flex, Flash 3D | Leave a comment
John Grden sai tähän upeaan animaation inspiraationsa You Tuben kautta monelle tutuksi tulleesta “Christmas Lights Gone Wild“-pätkästä. Scenen mallinnus on toteutettu koko komeudessaa Swift3D:llä. Vaikka grafiikka sinänsä ei ole kovin ihmeellistä, vaikuttavan animaation Johnin luomuksesta tekee kamera-ajot sekä synkkaus muusikin kanssa.
Mainittaakoon vielä, että Swift3D:stä löytyy tuki PaperVision3D moottorille ja kehitystä jatketaan tulevaisuudessa.
“Papervision3D is an open source 3D rendering engine for Adobe Flash, which means that Electric Rain has little or no influence over where it goes in the future. It also means that there will be things that don’t always work exactly as we would like. Having said that, we will be in regular contact with the guys developing Papervision3D and it is our goal to make Swift 3D the premier tool for creating Papervision3D projects. They are already giving us great feedback on where we need to take Swift 3D in the near future.”
Swift 3D and Papervision3D
Jan
24
ActionScript 3.0: Vaikeaa vai helppoa?
Kategoria AS3, Flash & Flex, General | 1 comment
Colin Moock kirjoittaa loistavan artikkelin (ActionScript 3.0: Is It Hard or Not?) ko. aiheesta insideria.com sivustolla. Monet hylkäävät AS3:n pelkästään ennakkoluulojen perusteella. Onko AS3 todella vaikeampi oppia kuin edeltäjänsä? Kannattaa lukea myös aiheeseen liittyvät kommentit.
Jan
23
Progressive stream – onComplete
Kategoria AS3, Flash & Flex | 3 comments
This post is kind of related to the previous one. I think it was a bit misleading. I stated there that it is possible to detect NetStreams “onComplete” with onPlayStatus handler. And that is partially true. But not in case of using progressive stream (progressive download). I should have mentioned it but I didn’t know about that until today
.
It seems that there is no efficient way detect whether the playback has completed or not. At least there is no built-in logic for this in Flash (concerns only progressive stream). There is, however, at least one way to accomplish this task. And I’m pretty sure you’ve already guessed it. Comparing playback time with the total length of the file. Needles to say that there is nothing new about this but I wanted to create an easy way implement this feature in the code.
So I created new class called “MediaStream” (extends NetStream) and custom “StreamEvent” for you to use with it. This way you don’t have to play around with that nasty NetStream.client crap anymore.
OK… Enough with all this talking. Download the source from the link below (and move the class files to your Flash class path).
Jan
22
NetStream “onComplete” (FMS2)
Kategoria AS3, Flash & Flex | 8 comments
Normally I do this in finnish but this time I’m making an exeption.
So let’s get down to business. I’ve been working this whole day on flv-player (streaming from FMS2). It was all going pertty smoothly until I had to find a way to determine wheter the flv was still playing or reached the end (or completed). At first it seemed like there is no efficient handler to detect this. At least I didn’t find an answer from Google
.
Well the thing is NetStatusEvent.NET_STATUS’ code property does not have a value “NetStream.Play.Complete”. “NetStream.Play.Stop” is the closest match but it seems like it is triggered a second or a few before the flv actually ends. Second drawback is that you also get that value when user stops the playback. So that is no good.
Then I tried what the onPlayStatus handler has to offer. And guess what… when the playback is completed onPlayStatus’ code property has a value of “NetStream.Play.Complete”. How come I’ve never heard about this “onPlayStatus”… until now ofcourse.
So heres the code:
ns = new NetStream(myNetConnection); ns.client = this; <a href="http://www.timovirtanen.com/2008/01/22/netstream-oncomplete-fms2/#more-181" class="more-link">Read more</a>
Jan
18
FPSCounter
Kategoria AS3, Flash & Flex | Leave a comment
Toisinaan raskaampia sovelluksia testatessa on hyvä saada selville montako framea kone jaksaa sekunnissa rendata. Vaikka jo visuaalinen kokemus kertoo paljon (ja saattaa useissa tapauksissa riittää) numerot kertovat totuuden selkeämmin.
Pyörää ei kuitenkaan kannata keksiä aina uudelleen. Tässä siis oiva väline testaukseen.
FPSCounter toimii seuraavasti:
FPSCounter.getFPS(stage);
FPSCounter luo dynaamisen tekstikentän, jossa tulos esitetään. Teksti on oletuksena mustan värinen (0×000000), mutta halutessa voit syöttää getFPS()-metodille valinnaisen parametrin, joka määrittää tekstikentän värin esim. (0xFFFFFF). Tämä on tarpeen, jos oletuksena käytettävä musta väri sekoittuu pahasti taustaan.
package { import flash.display.*; import flash.text.TextField; import flash.utils.getTimer; import flash.events.Event; <a href="http://www.timovirtanen.com/2008/01/18/fpscounter/#more-178" class="more-link">Read more</a>
Jan
17
SearchCube
Kategoria Flash & Flex, Flash 3D | Leave a comment
SeachCube on visuaalinen hakukone, joka esittää haun tulokset kolmiulottoisen kuution sivuilla. Paketti on pantu kasaan Sandy 3D Enginen and Tweenerin voimin, eikä lopputulos ole hassumpi.
Mielenkiintoisen aiheesta tekee se, että projekti on saanut alkunsa pienimuotoisesta kokeilusta. Ikäänkuin harjoitustyönä. Taustatyön tekee Google AJAX Search API.
Kannattaa ehdottomasti käydä testaamassa
.
SearchCube
Jan
17
BackgroundScalerin avulla skaalautuvan taustakuvan (kuvatiedosto) liittäminen on helppoa. Kuva skaalautuu automaattisesti, kun ikkunan kokoa muutetaan.
Luokka on staattinen eli siitä ei tarvitse luoda erillistä objektia. Alla selvitys parametreista.
- stageReference:Stage = stagen viite
- url:String = kuvan polku
- aspedtRatio:Boolean = säilytetäänkö kuvasuhde (true)
- smoothImage:Boolean = kuvan pehmennys (true)
- useUpperCorner:Boolean = tällä parametrilla määritetään kuvan “rekisteripiste” (true “yläkulma”)
Pakolliset parametrit lihavoituna, oletusarvot suluissa
Huomaa siis, että swf- ja flv-tiedostojen lataus ei onnistu!
Homma toimii seuraavasti. Kirjoita alla oleva Flashin aikajanalle ensimmäisenn frameen ja julkaise. Korvaa “myImage.jpg” ladattavan kuvan nimellä tai polulla.
// loadBackGround(stageReference, url [, aspectRatio, smoothImage, useUpperCorner]); BackgroundScaler.loadBackGround(stage, "myImage.jpg");
Jan
16
ULTRAKILLZ 3D Flash-räiskintää
Kategoria Flash & Flex, Flash 3D, YouTube | 2 comments
Flash-räiskintää Counter-Strike/Call of Duty 4/Quake 3 Arena tyyliin.
“Ultrakillz is a Free to play, Real-time Multiplayer First Person shooting game created for Flash player version 9 which is heavily influenced by (but not affiliated with) our favourite games Counter-Strike (in particular the custom AWP and Deagle maps) Call of Duty 4 and Quake 3 Arena.
If you enjoy playing FPS (first person shooter) games on your console or home PC but don’t have it installed at work, school or college – but you need to shoot someone in the face – then you’re in the right place.”
Jan
15
Löysin tänään Adoben Developer Centeristä Stefan Richterin kirjoittaman tutoriaalin (Delivering Flash Video: Dynamic Bandwidth Detection with Macromedia Flash Communication Server) etsiessäni kätevää tapaa tunnistaa kätevästi käyttäjän koneen kaistanleveys videostriimiä varten.
Skripti ei kuitenkaan sellaisenaan soveltunut käyttööni vaan tarvitsin siitä AS3-version. Modifioin skriptiä hieman ja tein uuden luokan tarkistusta varten (BandWidthCheck.as) sekä custom eventin (BandWidthEvent.as), joka laukaistaan kun testi on valmis.
Lue alkuperäinen artikkeli ja lataa esimerkkitiedostot (bwcheck.zip)
BandWidthCheck.as ja BandWidthEvent.as
bandwidthcheck.zip
