Reyco1’s Flash Blog Just another flash blog… Or is it?

"Ive been burned too many times!" I mean, what can I say... I've been working with Flash since it was called Future Splash and as much as you get to know, you never know it in its entireity. With that in mind, here you will find all the solutions I've been able to implement through the past years along with experiments, classes and other stuff!

SWF embedding problem with SWFObject 2.0

Reynaldo May 26th, 2008

For the last week or so I have been having loads of issues trying to embed a swf onto an HTML page with SWFObject 2.0. It works wonders when its just a regular swf being embedded, but when the embedded swf tried loading another swf, nothing.

Now check this out, wanted to install FlashTracer so I did and I read that in order for it to work properly, I HAD to install the debug version of the Flash Player. As soon as I ran the application on the new player, I immediately got an error message:

SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller file:///C:/site.swf cannot access file:///C:/index.html.

After endless hair pulling and much reading and research I found the solution to the problem. All I had to do was add the following line to my embed code on html:

so.addParam(”allowScriptAccess”,”always”);

That did the job!

Blog facelift

Reynaldo May 26th, 2008

Hi All:

Decided to give the blog a new look considering I saw the same template a few times in one day on other blogs :)

After a few hours of searching, I finally decided on this one. I hope its not too crappy! :)

Box3D Class for Papervision3D

Reynaldo May 20th, 2008

Hi All!

Today I found myself with the need to create a cube, but in my case, I wanted to have all the sides of the cube treated as if they were planes. Also, I wanted to have more control over the inner workings of my cube hence the birth of the Box3D class.
All this class does is create a cube out of 6 planes primitives. It works very much like the EnhancedPlane class mentioned in an earlier post .

This is the result:

This movie requires Flash Player 9

You can get the source and example files here!

Tags: , , , , , ,

EnhancedPlane: interactivity simplified

Reynaldo May 18th, 2008

Hi all:

I’ve received a few requests in order to make interactivity on the EnhancedPlane class a bit more simple and straight forward, [EDIT: link updated] so here it is ;) . In order to get it working, you would have to import the InteractiveScene3DEvent event class:

import org.papervision3d.events.InteractiveScene3DEvent;

Now, set up your EnhancedPlane as so

var frontMaterial:MovieAssetMaterial = new MovieAssetMaterial("front", true);
var backMaterial:MovieAssetMaterial = new MovieAssetMaterial("back", true);

var materials:MaterialsList = new MaterialsList({
	ront: frontMaterial,
	back: backMaterial
});

doublePlane = new EnhancedPlane(materials, 250, 250, 16);
doublePlane.interactive = true;
doublePlane.addEventListener(InteractiveScene3DEvent.OBJECT_CLICK, rotatePlane);

view.scene.addChild(doublePlane);

As you can see, the EnhancedPlane class now has an interactive property which accepts a Boolean value, then simply listen to an InteractiveScene3DEvent and your set!

[EDIT] To access each side of the plane individually, all you have to do is

doublePlane.front

or

doublePlane.back

EnhacedPlane and PlaneGrid PV3D classes

Reynaldo May 4th, 2008

Hi!

It’s been a really long time since I posted anything and there are a ton of reasons for that including moving to New York, getting a new job and finding a new place. But you can trust that I will be posting on a more regular basis from now on ;)

I decided to come back with a couple of classes I cerated for use with the Great White branch of PaperVision3D.

EnhancedPlane
This class allows you to create a Plane primitive with two dynamic faces to which you can add different materials. In other words, it’ll have two unique sides!

Use:

var frontMaterial:ColorMaterial = new ColorMaterial(0x00FFFF);
var backMaterial:ColorMaterial = new ColorMaterial(0xFFFF00);

var materials:MaterialsList = new MaterialsList({front:frontMaterial,	back:backMaterial});

var myEnhancedPlane:EnhancedPlane = new EnhancedPlane(materials, 250, 250, 16);
this.scene.addChild(myEnhancedPlane);

The first argument the class accepts is a MaterialList with the “front” and “back” materials specified. After that, the class accepts 4 optional arguments: width, height, segments and name.

PlaneGrid
This class allows you to create a grid of (same width, same height) planes real easily!

Use:

var planesArray:Array = new Array();
for(var a:Number = 0; a<18; a++){
     var material:ColorMaterial = new ColorMaterial(0x00FFFF);
     var plane:Plane = new Plane(material, 320, 480);
     planesArray.push(plane);
}
var planeGrid:PlaneGrid = new PlaneGrid(planesArray, 6, 3, 5, 320, 480, "left");
this.scene.addChild(planeGrid);

The first argument is an array holding the planes you would like to be in the grid, the rest of the parameters are columns, rows, spacing, plane width, plane height, and alignment respectfully. The alignment can either be: “left”, “right” or “center”.

Both of the classes extend the DisplayObject3D so you can treat them like any other 3D display object/primitive.

You can get the classes here

[EDIT]

Thanks to my good friend Matt, I fixed a small error in the the EnhancedPlane class. Thanks dude! I also uploaded an example on how to set up your EnhancedPlane to have interactivity on both sides. You can find the example here.

Next »

  • Friends

  • Props

  • Donations

  • website counter
  • Archives

  • Feedburner