kinematics.jpgTä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…”

yleistä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

yleistä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.

yleistä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).

progressive-stream.zip

Read more

fms.pngNormally 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/" class="more-link">Read more</a>

yleistä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.zip

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/" class="more-link">Read more</a>

searchcube.pngSeachCube 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

yleistä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");

Read more

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.”

www.ultrakillz.com

fms.pngLö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)

Ohjeet sovelluksen asentamisesta FlashComiin löydät yllä mainitusta artikkelista.

BandWidthCheck.as ja BandWidthEvent.as
bandwidthcheck.zip

Read more

Next page →