At a recent project I had to make a video loop indefinitely and most importanly: seemless. I tried all kinds of different methods, including using FLV, F4V, M4V, FLVplayback component, the Video class, embedded video and a few other. The only solution that worked was (in my opinion) the most ...
I code snippet I tend to use quite often. And one that I tend to forget how I wrote the last time i used it.
while (this.numChildren > 0)
{
removeChild(this.getChildAt(0));
}
Update:
And when you want to remove a child as a part of an event handler, do this:
event.target.parent.removeChild(event.target);
Let's say you want to ...
Posted in
AS3,
flash,
flexTags:
AS3,
child,
code,
event,
eventhandler,
flash,
flex,
parent,
remove,
removeChild,
snippet
If you have experienced getting only gibberish from the Arduino when tracing it's output using Flash, Flex or AIR, you might have misconfigured the socket server.
I spent a whole day trying to figure out why I only got square boxes, a couple of random numbers and an occasional 'f' now ...
Posted in
AS3,
arduino,
flash,
flexTags:
actionscript,
air,
arduino,
baud,
configure,
flash,
flex,
physical computing,
socket,
socket server
A couple of days ago I encountered a problem with Events. I clicked and object, but another returned the event. Despite adding mouseEnabled = false to the objects I didn't care about, I still couldn't figure it out. Events is nothing new to me, but this was beginning to get ...
For the time I'm working on a website and so far I've only spent some time doing research around all the ideas I have. One of them was to put all MovieClips in one externally loaded SWF. Loading the SWF is easy, but how do you access the individual MovieClips? ...
Posted in
AS3,
flashTags:
actionscript,
AS3,
assets,
big spaceship,
bulkloader,
document class,
external,
flash,
getdefinitionbyname,
load,
swf
I just stumbled across a very simple way of achieving an onReleaseOutside event when working with Papervision3D.
Now, why would I bring up Papervision3D in such a setting? If you, like me, have included a Papervision3D scene on a stage where other 2D objects (like MovieClips and other Flash components) are ...
Posted in
AS3,
flash,
papervision3dTags:
actionscript,
AS3,
blendmode,
button,
event,
fill,
flash,
graphics,
mouseevent,
multiply,
onrelease,
onreleaseoutside,
papervision3d,
pv3d,
release,
white
Sometime this winter a friend of mine (Knut Urdalen) introduced me to a part of mathematics called modular arithmetic. Now that is a nifty little thing.
In modular arithmetic, or modulus if you like, numbers reset themselves when reaching a given limit. Modulus is also known as "clock arithmetic", and the ...
Posted in
AS3,
flash,
flex,
mathTags:
actionscript,
AS3,
column,
flash,
flex,
grid,
loop,
math,
modulo,
modulus,
row
Earlier this week I finished a project for one of our clients. The client produces quite lot of video content, and wanted a video player that could be embedded in other websites. This was a rather straight forward project where I got to use a lot of things I already ...
Posted in
AS3,
flexTags:
AS3,
buffering,
custom preloader,
events,
flex,
FLV,
MetadataReceived,
NetConnection,
video,
VideoDisplay
Interesting (and more than a bit annoying) observation; neither the property totalTime or the event MetadataEvent.METADATA_RECEIVED will trigger unless the buffer is full.I just discovered this as I tried to dynamically set the bufferTime to be 30% of the total playtime (I calculate the bufferTime using totalBytes and bytesLoaded). But ...
A useful little snippet of code for when you want to copy text to the clipboard:
System.setClipboard(source.text);
Where 'source' is the id of e.g. a text field.