Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Applying Actions To Faces Of 3d Cube



im throwing together a quick portfolio and i want each face on a 3d cube to go to a different scene in the file on certain clicks on the faces

for instance face1 ("f1.jpg" in the folder that this script is loading the images from) links to "Scene2"

instead of setting the action to apply to the jpg (which i have no clue how to do) i was wondering if there was a way i could define faces of the cube and set actions to it......i am pretty amateur when it comes to actionscript but heres the source code





function rotateByMouse() {
var dx = _xmouse-this._x;
var dy = _ymouse-this._y;
var vAxis = {x:-dy, y:dx, z:0};
var amp = Math.sqrt(dx*dx+dy*dy);
this.rotateCube(vAxis,amp/500);
}
function faceOnAnimation() {
var fo = this.faceOrientation;
this.count++;
this.rotateCube(fo.axis,fo.faceRotate/10);
this.rotateCube(this.getFaceCenter(fo.face), fo.cornerRotate/10);
if (this.count>=10) {
this.onEnterFrame = null;
}
}
//----------------------------
setupFaceAction = function (cube) {
for (var i = 0; i<cube.faceArray.length; i++) {
var face = cube.faceArray[i];
face.onPress = function() {
if (!cube.fading) {
cube.faceOrientation = cube.getFaceOrientation(this);
cube.count = 0;
cube.onEnterFrame = faceOnAnimation;
cube.fading = true;
} else {
cube.fading = false;
cube.onEnterFrame = rotateByMouse;
}
};
}
};
//================================================== ==
for (var i = 0; i<numCube.holderArray.length; i++) {
var holder = numCube.holderArray[i];
var c = holder.attachMovie("charSymbol", "charSymbol", 2);
c.txt.text = holder._parent.id;
}
for (var i = 0; i<picCube.holderArray.length; i++) {
var holder = picCube.holderArray[i];
var c = holder.createEmptyMovieClip("loader", 2);
c.loadMovie("f"+(i+1)+".jpg");
}
setupFaceAction(numCube);
setupFaceAction(picCube);
numCube.onEnterFrame = rotateByMouse;
picCube.onEnterFrame = rotateByMouse;
picCube._xscale = picCube._yscale=150;



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 10-18-2008, 07:45 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Help Needed: Applying Images/links To Multiple Faces On A 3D Cube
I posted a fortnight ago, but it didn't seem to gain any attention, so I was hoping someone who missed it last time may be able to help me.

I've used two differing 3D Cube ActionScripts, each generates a different type of 3D Cube - one has colored faces and individual links for each side and the other has individual images/movie-clips per face but only one link for the whole cube.

What I want to achieve is a cube with 6 different imaged faces and 6 independent links, can anyone suggest how I could achieve this.

Thanks again

3D Cube With Moviclip Faces
Has anyone seen an interactive 3D object with each face being a movieclip?
Similar to FLAs > Experimental Actionscript > Basic 3D
but with movieclips on each face.
Or is this impossible??

3D Cube Spinning With Text On The Faces
Hi Everyone
I was wondering if there is anyone out there that could really help me. I am trying to do a 3D cube in Flash with text on the faces. I have Swift3D if that is a help.

Now what I would like to do with the cube is put text on the faces. And have the user spin the cube with a mouse postion action. I hope somebody understands me here.

It would be much apriciated if someone could help me. Thanks.

Yours faithfully
Leonardo

Depth Sorting Cube Faces.
Hi,
Im coding a 3d rotating cube. it works fine, however, id like to sort the depths of the faces correctly. i.e. the closest one to you has the highest depth.
in my program, the further away something is, the higher its Z value.
What ive been doing is for each face, i make a total of the Z values for the four corners.
I draw that face with depth (1000 - totalZ).
it works ok sometimes, but other times the wrong faces show on top.
is there another way to sort the faces?

Papervision Cube With Transparent Faces
I'm trying to make a papervision cube with transparent faces. Imaging a glass cube with words printed on each face, that is what i want to accomplish. The problem is, when i set the faces to be transparent, they don't show up that way. They show up with what seems like a black background behind them. Is that a default?

Can I Create A 3D Cube That Moves By The Mouse And Have Links On The Faces?
I am trying to create a 3d cube that rotates all ways and has links on all faces (or graphics)
I am using Flash 5
Do I first have to create a cube in another application?
Would appreciate any and all help.

Applying Actions
Hi,
I know you can apply an action to a specific object, but is there a way to apply an action to the whole flash movie?
thanks!

Applying Actions To Buttons.
This may seem a little infantile to some of the more veteran Flashers here but I need help making my buttons work. I do not know how to make my button on click goto and play a certain frame. I have tryed going to the button editor but it keeps telling me that the object I have selected cannot have actions applied to it. I am using Flash Mx 2004. Thank you for your help.

Applying Actions To Components
I have a button, that is a component to add paypal compatibility, which is awesome, but I have 1 snag I need to iron out.
my entire site is self contained (700px by 700px), so there's no scrollbars and so when someone clicks the "buy now" button, and is redirected to the paypal page, there's no scrollbar there as well... what would be the easiest way around this? could I add an action to the component to make that pop-up in it's own resizable window? I guess the problem is that since the button's a component, I don't know the url to put in the getUrl action... any ideas??? thanks...

Applying Actions To More Than One Symbol
is it possible to apply actions to a whole load of symbols? Reckon it'd make it easier than typing out the same line of code and just changing the instance name!!

Applying Actions To Dynamically Created MCs
if you have an MC, you can apply actions to it like
code: onClipEvent(load){
dadada
}

Is there anyway to take an MC that was loaded with attachMovie and make it use onClipEvent(load) etc? I know I can load it into a shell movie clip that has actions on it but I don't necessarily know how many there will be.

Thanks.

Applying Actions To Multible Objects
Can anyone tell me how to group objects together so that you can change their parimeters all at once. Like if I have a 7 boxes on screen with the instance name box1, box2, ect..... and i wanted to do change them via action script, like make them all partailly invisible when an event happens. How would I do that. I've tried stuff like

box = ["_root.red", "_root.blue"];
box._rotation = 40;

and
box = [_root.red, _root.blue];
box._rotation = 40;

and

box = (_root.red), (_root.blue);
box._rotation = 40;

but they don't don't seem to work. One of them changes only the last one.

Loading Into A Holder Clip And Applying Actions To It
hi all,

I'm having trouble loading a jpg into a holder clip and what I'd like to do is have a series of actions "contained" within the holder clip which will be applied to a jpg when it's imported by clicking on a menu button.

I don't know how easy it is to explain so I've put the movies up here and added comments/notes to the "pano_display_unit_loadjpgs.fla" file which will hopefully be more self explainatory than this post!

If anyone could spare some time to take a look at this and help me out I'd be most grateful! I am considering paying for help on this project but at the moment I'd like to see how far I can get using the boards and then perhaps pay for further help depending on how well this goes

Cheers!

James.

Applying Actions To Movieclip Frames Not Yet Displayed
Hi,
I've been developing a project that displays FLVs through a video object using the netstream/netconnection method. New FLVs are loaded into the display via buttons in a side-nav MC which, trigger a new netstream path.
In order that I didn't have to apply individual code to each of these buttons, I instead wrote the following actionscript that looks at the instance name of the button that was onReleased, and takes the number on the end of the instance name and uses it as the path to the FLV..


Quote:




//------- SETUP NETSTREAM/CONTROLLER FUNCTIONS/LOADING BAR/SCRUB/TXT -----------

var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);

stream_ns.setBufferTime(15);


stream_ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}

if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
}

if(info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
}

my_video.attachVideo(stream_ns);
stream_ns.play("http://www.dedicatedmicros.com/ukftp/FLVHUB/FLV/1.FLV");


//------- DYNAMIC FLV/BUTTON CODE --------------------
//use a for loop to reduce repetition of the code
for(i=1;i<80;i++){
theButton=_root.scrollerMC.thumbscroll["vid"+i];
//this variable stores what number button it is
theButton.thisNum=i;

theButton.onRelease = function() {
//set stream
stream_ns.play("http://www.dedicatedmicros.com/ukftp/FLVHUB/FLV/"+this.thisNum+".FLV");
}




controllerMC.rewindBTN.onRelease = function() {
stream_ns.seek(0);
}
}


As i've labelled all my FLVs 1.flv 2.flv etc and the buttons that call them as vid1 vid2 etc, this code is working. However, as my side-nav containing these buttons is broken into three frames, which switch as the user changes a selection in my combo-box; the code (written in my root timeline) is only being applied to the first and currently displaying frame of my side-menu.

Therefore, my question is this.. How can I apply that same code to the second and third frames of the movieclip containing my buttons?

I have uploaded my SWF/FLA to my server for your reference, the urls to each are as follows:
http://www.dedicatedmicros.com/ukftp...rate_press.htm
and
http://www.dedicatedmicros.com/ukftp/FLV_HUB/hub.fla

Currently there are only associated FLVs uploaded for Le Mans Start and Le Mans End sections although I will be uploading for the cycling section throughout the day.

Any advice you can provide is greatly appreciated,

Thanks,
DigiPencil

Problems Applying Actions To Movie Clip
HI, I am a total beginner with flash- I am following a tutorial at www.flashninjaclan.com/tutorialpage.php?ID=56

I have created a rectangle for the paddle- converted it to a movie clip and then- when I try and apply an action to one of my paddles the actions box comes up with a message saying "current selection cannot have actions applied to it" WHY???

it lets me put in code if a layer is selected rather than an object.

any help gratefully recieved.

thanks

Applying Actions To Movieclip Frames Not Yet Displayed
Hi,
I've been developing a project that displays FLVs through a video object using the netstream/netconnection method. New FLVs are loaded into the display via buttons in a side-nav MC which, trigger a new netstream path.
In order that I didn't have to apply individual code to each of these buttons, I instead wrote the following actionscript that looks at the instance name of the button that was onReleased, and takes the number on the end of the instance name and uses it as the path to the FLV..


//------- SETUP NETSTREAM/CONTROLLER FUNCTIONS/LOADING BAR/SCRUB/TXT -----------

var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);

stream_ns.setBufferTime(15);


stream_ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}

if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
}

if(info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
}

my_video.attachVideo(stream_ns);
stream_ns.play("http://www.dedicatedmicros.com/ukftp/FLVHUB/FLV/1.FLV");


//------- DYNAMIC FLV/BUTTON CODE --------------------
//use a for loop to reduce repetition of the code
for(i=1;i<80;i++){
theButton=_root.scrollerMC.thumbscroll["vid"+i];
//this variable stores what number button it is
theButton.thisNum=i;

theButton.onRelease = function() {
//set stream
stream_ns.play("http://www.dedicatedmicros.com/ukftp/FLVHUB/FLV/"+this.thisNum+".FLV");
}


controllerMC.rewindBTN.onRelease = function() {
stream_ns.seek(0);
}
}


As i've labelled all my FLVs 1.flv 2.flv etc and the buttons that call them as vid1 vid2 etc, this code is working. However, as my side-nav containing these buttons is broken into three frames, which switch as the user changes a selection in my combo-box; the code (written in my root timeline) is only being applied to the first and currently displaying frame of my side-menu.

Therefore, my question is this.. How can I apply that same code to the second and third frames of the movieclip containing my buttons?

I have uploaded my SWF/FLA to my server for your reference, the urls to each are as follows:
http://www.dedicatedmicros.com/ukftp/FLV_HUB/corporate_press.htm
and
http://www.dedicatedmicros.com/ukftp/FLV_HUB/hub.fla

Currently there are only associated FLVs uploaded for Le Mans Start and Le Mans End sections although I will be uploading for the cycling section throughout the day.

Any advice you can provide is greatly appreciated,

Thanks,
DigiPencil

Applying Actions To Movieclip Frames Not Yet Displayed
Hi,
I've been developing a project that displays FLVs through a video object using the netstream/netconnection method. New FLVs are loaded into the display via buttons in a side-nav MC which, trigger a new netstream path.
In order that I didn't have to apply individual code to each of these buttons, I instead wrote the following actionscript that looks at the instance name of the button that was onReleased, and takes the number on the end of the instance name and uses it as the path to the FLV..

//------- SETUP NETSTREAM/CONTROLLER FUNCTIONS/LOADING BAR/SCRUB/TXT -----------

var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);

stream_ns.setBufferTime(15);


stream_ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}

if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
}

if(info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
}

my_video.attachVideo(stream_ns);
stream_ns.play("http://www.dedicatedmicros.com/ukftp/FLVHUB/FLV/1.FLV");


//------- DYNAMIC FLV/BUTTON CODE --------------------
//use a for loop to reduce repetition of the code
for(i=1;i<80;i++){
theButton=_root.scrollerMC.thumbscroll["vid"+i];
//this variable stores what number button it is
theButton.thisNum=i;

theButton.onRelease = function() {
//set stream
stream_ns.play("http://www.dedicatedmicros.com/ukftp/FLVHUB/FLV/"+this.thisNum+".FLV");
}


controllerMC.rewindBTN.onRelease = function() {
stream_ns.seek(0);
}
}

[F8] Applying Actions Dynamically To Duplicated Movie Clips
Hi all,
I was just wondering if it is possible to change properties on duplicate movie clips dynamically? I want to apply multiple actions like shake, follow the mouse and change colour to clips that have been generated from an instance on the stage. At the moment, I can get them all to shake but only the instance to move with the mouse and change colour.

//Shake Code placed on the instance
onClipEvent (load) {
//movie width/height
height = 200;
width = 300;
//------------------------//
//makes everything random //
//------------------------//
this._x = Math.round(Math.random()*width);
this._y = Math.round(Math.random()*height);
var temp =Math.random()*150;
this._xscale = this._yscale=temp;
//setting initiaion position
cx = this._x;
cy = this._y;
}
onClipEvent (enterFrame) {
//causes the object to be offset
this._x = cx+(1+Math.random()*2);
this._y = cy+(1+Math.random()*2);

}



//Duplicate Code placed on frame 1 of layer 1
nbug = 10;

{
for (i = 1; i <= nbug; ++i)

var mc = bug.duplicateMovieClip('bug_' + i, i);

}



//Follow the mouse code placed on frame 1 of layer 2
bug.onEnterFrame= function() {
var xMouse = _root._xmouse;
var yMouse = _root._ymouse;
if(Math.abs(xMouse - this._x) < 1) {
this._x = xMouse;
this._y = yMouse;
} else {
this._x -= (this._x-xMouse) / 6;
this._y -= (this._y-yMouse) / 6;
}
}



//Colour Target placed on frame 1 of layer 3
bug.belly.Color = new Color(bug.belly);



//As I'm attempting to use sliders to change the colour of the bug's graphic, I also have code on an invisible controller on the stage.

onClipEvent(enterFrame){
_parent.redRGB = (_parent.RedSlider.RedControlBar._y+122).toString( 16);
if (length(_parent.redRGB) == 1)
_parent.redRGB = "0" + _parent.redRGB;
_parent.greenRGB = (_parent.GreenSlider.GreenControlBar._y+122).toStr ing(16);
if (length(_parent.greenRGB) == 1)
_parent.greenRGB = "0" + _parent.greenRGB;
_parent.blueRGB = (_parent.BlueSlider.BlueControlBar._y+122).toStrin g(16);
if (length(_parent.blueRGB) == 1)
_parent.blueRGB = "0" + _parent.blueRGB;
finalColor = "0x" + _parent.redRGB + _parent.greenRGB + _parent.blueRGB;
_parent.bug.belly.Color.setRGB(finalColor);
_parent.bug.belly.Color.setRGB(finalColor);
}


This is a combination of a number of online tutorials namely:
http://www.kirupa.com/developer/mx/vibrate.htm
http://www.spoono.com/flash/tutorial...rial.php?id=24
http://www.flashvault.net/tutorial.asp?ID=115

Does anyone have any idea how I could apply these actions to the duplicated clips and not just the instance?
Many Thanks!

Applying Actionscript Actions To Buttons - Why Does It Stop The Button From Working?
I am using actionscript to duplicate buttons on stage and then applying actionscript to each button (such as mybutton.onRelease = function (){
"my function goes here"
}

the actionscript works, but the button states do not work anymore....the button is static and will not "rollover" etc...it will only call the function when pressed/released etc.

any thoughts?

XML Loading Image To 1side Of Cube + Looping Cube
I'm currently stuck on loading image through xml into a surface of a cube. The cube have 6 surface with different MC. I wanted to load in image to one of the MC, and duplicate the cube according to the amount of image in the XML file.


ActionScript Code:
private var materials:MaterialsList=new MaterialsList({front:new MovieAssetMaterial("surFront",false,true),back:new MovieAssetMaterial("surBack",false,true),right:new MovieAssetMaterial("surRight",false,true),left:new MovieAssetMaterial("surLeft",false,true),top:new MovieAssetMaterial("surTop",false,true),bottom:new MovieAssetMaterial("surBottom",false,true)});



ActionScript Code:
for (var i:Number=0; i < picList.length(); i++) {                imageLoader=new Loader  ;                imageLoader.load(new URLRequest(picList[i].thumb));                imageLoader.x=25;                imageLoader.y=i * 100 + 25;                imageLoader.name=picList[i].largeimg;                addChild(imageLoader);                //----------------------------------------------------------------------------------------                cube=new Cube(materials,60,2,80,10,10,10);                cubeArray.push(cube);//send cube into arrays                cube.name="cube" + i;// set instance name                cube.x=Math.random() * 950 - 460;                cube.y=Math.random() * 700 - 330;                cube.z=+5;                cube.rotationZ=Math.random() * 360;                scene.addChild(cube);            }

Currently the picture is loaded into the stage. How could I assign it to load a image into the surface "front", then only duplicate the cube, with different front image each cube?

AS3 - XML Thumbnail In Cube Surface + Loop Cube
I was trying to load thumbnails into one of the surface(front) of my cube, and duplicate the cube amount according to the numbers of images I have in my images.

This is what i have so far and its not working.


ActionScript Code:
var materials:MaterialsList = new MaterialsList(
            {
            front: new MovieAssetMaterial( "surFront", false, true ),
            back: new MovieAssetMaterial( "surBack", false, true ),
            right: new MovieAssetMaterial( "surRight", false, true ),
            left: new MovieAssetMaterial( "surLeft", false, true ),
            top: new MovieAssetMaterial( "surTop", false, true ),
            bottom: new MovieAssetMaterial( "surBottom" , false, true)
            } );
 
            var surfaceArray:Array = ["front","back","right","left","top","bottom"];
 
            //load into surfaceArray[0]
            var xml:XML;
            var xmlList:XMLList;
            var xmlLoader:URLLoader = new URLLoader();
 
            xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
 
 
            xml = XML(event.target.data);
            xmlList = xml.children();
            trace(xmlList.length());
 
            for (var i:Number=0; i<xmlList.length(); i++) {
                for (var j:Number = 0; j<surfaceArray.length; j++) {
                    cube = new Cube( materials, 40, 5, 42, 10, 10, 10 );
                    cube.name = "cube" + i;// set instance name
                    trace(cube);
                    cube.x=Math.random() * 980 - 480;
                    cube.y=Math.random() * 730 - 350;
                    cube.z = -70;
                    cube.rotationZ=Math.random() * 360;
                    p.addChild( cube );
                }
            }

Lee's Cube - How To Make The Cube Not Centered?
I have completed this papervision3d tutorial: http://gotoandlearn.com/play?id=68
But by default the cube is always centered on the stage. How to make the cube be in the top-left of the screen for example and not centered?

Here is the code i use:
Code:

import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.objects.special.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import org.papervision3d.materials.special.*;
import org.papervision3d.materials.shaders.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.lights.*;
import org.papervision3d.render.*;
import org.papervision3d.view.*;
import org.papervision3d.events.*;
import org.papervision3d.core.utils.*;
import org.papervision3d.core.utils.virtualmouse.VirtualMouse;

var viewport:Viewport3D = new Viewport3D(0,0,true,true);
addChild(viewport);
viewport.buttonMode = true;

var renderer:BasicRenderEngine = new BasicRenderEngine();
var scene:Scene3D = new Scene3D();
var camera:Camera3D = new Camera3D();

camera.zoom = 11;
camera.focus = 100;

var mm1:MovieMaterial = new MovieMaterial(face1);
mm1.interactive = true;
mm1.animated = true;
mm1.smooth = true;
var mm2:MovieMaterial = new MovieMaterial(face2);
mm2.interactive = true;
mm2.animated = true;
mm2.smooth = true;
var mm3:MovieMaterial = new MovieMaterial(face3);
mm3.interactive = true;
mm3.animated = true;
mm3.smooth = true;
var mm4:MovieMaterial = new MovieMaterial(face4);
mm4.interactive = true;
mm4.animated = true;
mm4.smooth = true;
var mm5:MovieMaterial = new MovieMaterial(face5);
mm5.interactive = true;
mm5.animated = true;
mm5.smooth = true;
var mm6:MovieMaterial = new MovieMaterial(face6);
mm6.interactive = true;
mm6.animated = true;
mm6.smooth = true;

var cube:Cube = new Cube(new MaterialsList({front:mm1,back:mm2,left:mm3,
                                right:mm4,top:mm5,bottom:mm6}),
                   400,200,200,10,10,10)

scene.addChild(cube);
cube.x = 0;
cube.y =0;

addEventListener(Event.ENTER_FRAME,loop);
function loop(e:Event):void{
   var xDist:Number = mouseX - stage.stageWidth/2;
   var yDist:Number = mouseY - stage.stageHeight/2;
   cube.rotationX -= yDist * 0.05;
   cube.rotationY -= xDist * 0.05;
   renderer.renderScene(scene,camera,viewport);
   
}

Switching Faces
Ok heres the situation, I have a osama bin laden flash game, where you have to shoot him when his head pops up. I was wondering if there was a program that would allow me to just simply switch the face of Osama to a pic of a friend of mine. I just learning Macromedia right now and I know very little. I thought a fun project would enlighten me a bit

Please help, any info you could spare would be much appreciated

thanx in advance

How Do I Do The 'faces' Game?
does any one remember the game "faces" where you can mix 'n match faces can any one give me a suggestion of how i can do this?: i've made a start using masking but i don't know if that was such a good idea. would i have to do each component of the faces individually and use actions? there has to be an eaier way surely

Tweeninig Faces...
HI.
I am tring to tween one face into another, I start with a bmp, trace it, then shape tween it, one comes in from the corner, and goes out as the other is coming in. Is there a way to tween from one shape to another?
tnks

Animating Faces..
Hey,

Quick question, I have just done a drawing of scooby doo and shaggy, and I want to be able to animate shaggy's mouth. He is smiling, but I want to make it so he smiles, then it moves into a shocked looked. I have been trying to do this for past hour now lol, and have had no success, anyone got any ideas?

Thanks,
Paul

Moving Faces
We are tring to produce moving charachters as in
http://www.oddcast.com/home/sitepal and various others. We have the lypsync
okay but how do we create the face to move following the mouse and turning
as if it is 3D.

Any help appreciated

SteveW

Faces And Depths
Um, i am not really asking for help on faces and depths, but there is a tutorial on kirupa.com thats called "Faces and Depths" its by Senocular, i was wondering if i could find the final .fla of that tutorial and if it is possible to use that cube as a navigation button.

Faces On Hillmancurtis
I realyl wonder if those faces appear on hillmancurtis' site are video files ?
If so how did they play so slowmotion like that? How its done ?

Faces And Depths
Um, i am not really asking for help on faces and depths, but there is a tutorial on kirupa.com thats called "Faces and Depths" its by Senocular, i was wondering if i could find the final .fla of that tutorial and if it is possible to use that cube as a navigation button.

Faces On Hillmancurtis
I realyl wonder if those faces appear on hillmancurtis' site are video files ?
If so how did they play so slowmotion like that? How its done ?

Assigning Font Faces
How do you assign a font face to text field variable using actionscript.

Anyone?

Moving Faces And Eyes
I have a face I want to move with the mouse. I want it to move certain facial positions per mouse position. I got the eyes to do that, but I had to set them to conform to a rectangle. I made it so the face moves to buttons outside of the face but it wont work on one side, because of the rectangle constraints. If anyone knows WHAT to do or how to make it, please help me. There are examples just like what i want on oddcast.com I'd be VERY appreciative if someone would just send me an example file for me to work from. Mine is just a little cartoony figure that I need to use, but I seriously need help. Thanks!

Morphing Faces--tweening Help
Was trying to morph a face on one frame with a different face on a later frame...so that there would be a morph effect...if this is possible, can someone help me out on how to do it? (If the faces need to be symbols-graphic, what tween, etc.) THANKS!

Exotic Font Faces...
Hi there,

I have a quite exotic question I'd like to ask:

If I have to put some Thai-Font into a Flash-Application - what problems do occur, beginning with installing the font on my OS and using this font within TextFields?

My current task is THAI-Font.

I fond a short thread about this, but it didn't really help me.

Does anyone have some advice on this topic?

Cheers,

Beginer Faces Actionscript, Help
Hi
i m a beginer in actionscript, just struggling what's the effective way for me to start learning/practising actionscript to become advanced user.
*I've learnt some programming stuff before: C programing, VB, database, a bit of ASP & PHP & javascrit, BUT just dont know how to get started to make use of the actionscript to enrich my flash stuff..
*The actionscript tutorial in this site divided into different section that seems not Im looking for in this stage, im looking for some tutorials teaching you from the very beginning (more guidence instead of learn a piece of script here & jump to learn a piece there)

ThAnks..
Tom

Uploading Jpg's Of Faces And Placing Them In MC's
how exactly can I create something like this:
http://www.jibjab.com/sendables/303/...ng_You/Breakin

an option to upload a picture and place it in a video?

Thanks for the help!

Beginer Faces Actionscript, Help
Hi
i m a beginer in actionscript, just struggling what's the effective way for me to start learning/practising actionscript to become advanced user.
*I've learnt some programming stuff before: C programing, VB, database, a bit of ASP & PHP & javascrit, BUT just dont know how to get started to make use of the actionscript to enrich my flash stuff..
*The actionscript tutorial in this site divided into different section that seems not Im looking for in this stage, im looking for some tutorials teaching you from the very beginning (more guidence instead of learn a piece of script here & jump to learn a piece there)

ThAnks..
Tom

Multiple Type Faces In Same Text Box?
I wish to to type two different languages in one text box and switch between them.

Currently I'm adding a variable using html without problems as screen captured here:

http://www.serinya.com/font.jpg

However, it would be cool to have a formatting toolbar above the text box (ex: like MS word)for the user to choose the fonts, bold, italic, etc)while typing along.

Anyone?

Kim

Smiley Faces In Text Boxes
For a utility I'm involved in making I need to be able to allow the user to be able to insert picture/imagery like smiley faces and the like into a text feild. Is there a way to do this? It needs to look like the smiley face or whatever else, and it needs to flow with the text as text is added or changed before and after it, etc.

Too, the string needs to be able to be extracted and saved out for display in html/asp etc. so I guess the smiley face would need some way of being extracted as the characters that make up that graphic, like the standard "" I guess.

Is this possible or too difficult?

How Many Type Faces Can Flash Handle?
I have a client who wants to use loads of font faces maybe even up to 700 different ones.

I have never seen this many fonts in a Flash movie, but then again I have not heard anything about any limits to how many fonts a flash movie can have.

Does anybody have any experiences with huge amounts of fonts in flash movies??

thanks in advance

Multiple Type Faces In One Field
What I would like to accomplish is the following:

HTML text field with loaded xml text in HTML format and an attached style sheet. The style sheet has styles that specify fonts that are embedded in the fla's library and the HTML text styles the text accordingly resulting in more that one type face in a dynamic text field. Is this possible?

I know how to do all the above except get more than one font in a field. I can style the text in other ways (size, tracking, color, etc) but not font-family, or whatever the css would be. Perhaps this is not posssible, or can be achieved in another way.

Any help appreciated.

Changeing Faces : Panning And Buttons
Confussed Is exactly where I am right now. I'm begging, any one who can help. please save me.
Delima:
I have very little experience with panning and making move controled by the mouse position. I working on redoing my website www.cssolutions.itgo.com before I actually register a domain name and put it out there futher. Im trying to flash it. Here's a breakdonw of what I am trying to do.
1) Im trying to take my logo ball and make it rotate according to where mouse ponter is on it to reveal a link.

2) when the link is clicked the ball rolls (as it would seem ) into the upper right hand corner of the stage and gets small to give the effect that it is rolling into the background and shows a list of links below it

see csball


OOOO
O O
O O
OOOO
|_link1
|_link2
|_link3

3) I have already created the window transitions that will display the contents of each link. and I would like to keep everything as streamline as posible.

Primarily I need help in making the ball rotate and displaying the links

Help me please.

Problem With Tutorial Help 3d Faces And Depth
Hi all, been working thru the tutorials and ive been pretty successful with most of them up until now, when trying the tute from this url

http://www.kirupa.com/developer/acti...ces_depths.htm

Nothing appears when i goto test the movie, any ideas? heres the actionscript code im working with - is this right? is this what is meant to be in place? some of it is included from previous tutorials in the chapter

this.createEmptyMovieClip("theScene", 1);
theScene._x = 150;
theScene._y = 150;

focalLength = 300;
make3DPoint = function(x,y,z){
var point = new Object();
point.x = x;
point.y = y;
point.z = z;
return point;
};
make2DPoint = function(x,y, depth, scaleFactor){
var point = new Object();
point.x = x;
point.y = y;
point.depth = depth;
point.scaleFactor = scaleFactor;
return point;
};
Transform3DPointsTo2DPoints = function(points, axisRotations){
var TransformedPointsArray = [];
var sx = Math.sin(axisRotations.x);
var cx = Math.cos(axisRotations.x);
var sy = Math.sin(axisRotations.y);
var cy = Math.cos(axisRotations.y);
var sz = Math.sin(axisRotations.z);
var cz = Math.cos(axisRotations.z);
var x,y,z, xy,xz, yx,yz, zx,zy, scaleFactor;

var i = points.length;
while (i--){
x = points[i].x;
y = points[i].y;
z = points[i].z;

// rotation around x
xy = cx*y - sx*z;
xz = sx*y + cx*z;
// rotation around y
yz = cy*xz - sy*x;
yx = sy*xz + cy*x;
// rotation around z
zx = cz*yx - sz*xy;
zy = sz*yx + cz*xy;

scaleFactor = focalLength/(focalLength + yz);
x = zx*scaleFactor;
y = zy*scaleFactor;
z = yz;

TransformedPointsArray[i] = make2DPoint(x, y, -z, scaleFactor);
}
return TransformedPointsArray;
};
pointsArray = [
make3DPoint(-50,-50,-50),
make3DPoint(50,-50,-50),
make3DPoint(50,-50,50),
make3DPoint(-50,-50,50),
make3DPoint(-50,50,-50),
make3DPoint(50,50,-50),
make3DPoint(50,50,50),
make3DPoint(-50,50,50)
];
for (i=0; i < pointsArray.length; i++){
attachedObj = theScene.attachMovie("redballoon", "redballoon"+i, i);
}
cubeAxisRotations = make3DPoint(0,0,0);
rotateCube = function(){
cubeAxisRotations.y -= this._xmouse/3000;
cubeAxisRotations.x += this._ymouse/3000;
var screenPoints = Transform3DPointsTo2DPoints(pointsArray, cubeAxisRotations);
for (i=0; i < pointsArray.length; i++){
currBalloon = this["balloon"+i];
currBalloon._x = screenPoints[i].x;
currBalloon._y = screenPoints[i].y;
currBalloon._xscale = currBalloon._yscale = 100 * screenPoints[i].scaleRatio;
currBalloon.swapDepths(screenPoints[i].depth);
}
};
theScene.onEnterFrame = rotateCube;

AS3 - Bitmap Geometry And Faces Data Persisting In The Flash Player
I am using cs4 up-to-date pv3d classes. Flex Gumbo 4.0 sdk. FP10.

..The problem i have is that bitmap, geometry and faces data persist in
the flash player after using unloadAndStop() to unload the pv3d swf
from the main app. I realise this is a poor way to do this but coming
from a basic knowledge of flash and having used earlier versions of
the api, before as3, i did not know any better.

I'm under tremendous time pressure. I need to know how i can
dispose of these elements the proper way. (1)How do i
reference them so i can dispose them, (2) How do i dispose of them correctly.
(3) How would i remove an event listener?

I've seen this (below) but some high level opinion/solution would be greatly appreciated.

Code:
var li:LoaderInfo = loader.contentLoaderInfo;
if(li.childAllowsParent && li.content is Bitmap){
(li.content as Bitmap).bitmapData.dispose(); // remove bitmap from memory
}
Could you pls help me. Christmas is coming soon and i'm feeling generous.

Saul.

Main App (Interface) Code portion:

<mx:State name="Car3DScene"
enterState="initSWF(event);"
exitState="unloadSWFHandler(event);">
<mx:AddChild relativeTo="{panel1}" position="lastChild">

<mx:Canvas width="100%" height="100%"
minHeight="340" minWidth="920"
borderColor="#1d1d1d" borderThickness="1" borderStyle="solid"
backgroundAlpha="1" backgroundColor="#000000">
<mx:Image x="0" y="0" width="295" height="250"
id="myLogo" source="@Embed('assets/images/scene3dMainImage.png')"
autoLoad="true" maintainAspectRatio="false"/>
<mx:Script>
<![CDATA[
import flash.events.*;
import flash.net.URLRequest;
import mx.controls.SWFLoader;
import mx.events.FlexEvent;
import flash.display.Loader;

public var swfContent:MovieClip;

public function initSWF(e:Event):void
{
myLoader.addEventListener(Event.INIT,loadHandler,f alse, 0, true);
myLoader.addEventListener(Event.UNLOAD,unloadSWFHa ndler,false, 0, true);
myLoader.load("assets/swfs/PV3DCanvasSWFFVPortWR.swf");
}

private function loadHandler(e:Event):void
{
swfContent = e.target.content;
}

private function unloadSWFHandler(e:Event):void
{
swfContent.loaderInfo.loader.unloadAndStop(true);
//myLoader.unloadAndStop(true);
}
]]>
</mx:Script>
<mx:SWFLoader x="295" y="0"
width="625" height="250"
minWidth="625" minHeight="250"
maintainAspectRatio="false"
scaleContent="true" blendMode="normal"
id="myLoader" alpha="1"/>
.................................................. .....
.................................................. .....

Here is the code of the incoming SWF:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
preloader="com.usppro.BasicCustomPreloader"
layout="absolute"
applicationComplete="init3D();">
<mx:Script>
<![CDATA[
import mx.controls.*;
import flash.display.*;
import objects.*;//The as3 geom (3d model) classes
import org.papervision3d.cameras.*;
import org.papervision3d.materials.*;
import org.papervision3d.materials.special.*;
import org.papervision3d.objects.*;
import org.papervision3d.objects.special.*;
import org.papervision3d.render.*;
import org.papervision3d.scenes.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import org.papervision3d.view.*;
import org.papervision3d.core.utils.*;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.core.geom.renderables.*;

private var camera :Camera3D;
private var renderer :BasicRenderEngine;
private var scene :Scene3D;
private var viewport :Viewport3D;
private var universe isplayObject3D;

private var c:CarFinal;//The car 3d model class
[Embed(source="/assets/Car_Black.jpg")]
private var CarTexture:Class;


private function init3D():void
{
Application.application.stage.align = StageAlign.TOP_LEFT;
Application.application.stage.scaleMode = StageScaleMode.NO_SCALE;
Application.application.stage.quality = StageQuality.LOW;
Application.application.stage.frameRate = 30;

viewport = new Viewport3D(625,250,false,false,true,true);
pv3dCanvas.rawChildren.addChild(viewport);
pv3dCanvas.rawChildren.addChild(new Stats());
renderer = new BasicRenderEngine();
scene = new Scene3D();
camera = new Camera3D(universe,18,200);
camera.x = 0;
camera.y = 0;
camera.z = -200;
createObjects();
addEventListeners();
}

private function createObjects():void
{
c = new CarFinal();
c.material = new BitmapMaterial(new CarTexture().bitmapData);
c.x = 0;
c.y = 0;
c.z = 0;

universe = new DisplayObject3D();
universe.addChild(c);

scene.addChild(universe);
universe.x = 200000;
universe.y = -200000;
universe.rotationY = -90;
camera.target = universe;
}

private function addEventListeners():void
{
addEventListener(Event.ENTER_FRAME, loop3D,false,0,true);
}

public function loop3D(e:Event):void
{
camera.target.x -= (((mouseX - (pv3dCanvas.width * 0.5)) * 12) + camera.target.x) / 24;
camera.target.y -= (((mouseY - (pv3dCanvas.height * 0.5)) * 12) + camera.target.y) / 24;

universe.yaw(-0.6);

renderer.renderScene(scene, camera, viewport);
}
]]>
</mx:Script>
<mx:Canvas width="625" height="250"
x="0" y="0"
blendMode="normal"
id="pv3dCanvas"
backgroundColor="#000000" backgroundAlpha="1">
</mx:Canvas>
</mx:Application>

..............................................
..............................................

Here is a code portion of the 3d car model class

package objects
{
import org.papervision3d.core.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.core.geom.renderables.Triangle3D ;
import org.papervision3d.core.geom.renderables.Vertex3D;
import org.papervision3d.core.math.NumberUV;
import org.papervision3d.core.proto.*;

public class CarFinal extends TriangleMesh3D
{

public var verts :Array;
public var faceAr:Array;
public var uvs :Array;

private function v(x:Number,y:Number,z:Number):void
{
verts.push(new Vertex3D(x,y,z));
}

private function uv(u:Number,v:Number):void
{
uvs.push(new NumberUV(u,v));
}

private function f(vn0:int, vn1:int, vn2:int, uvn0:int, uvn1:int,uvn2:int):void
{
faceAr.push( new Triangle3D( this, [verts[vn0],verts[vn1],verts[vn2] ], null,

[uvs[uvn0],uvs[uvn1],uvs[uvn2]] ) );
}

public function cobraCarFinal( material:MaterialObject3D=null, initObject:Object=null )
{
super( material, new Array(), new Array(), null );
verts = this.geometry.vertices;
faceAr= this.geometry.faces;
uvs =new Array();
v(108.544,-31.9748,-101.242);
...........................
f(1248,5195,5196,1248,5195,5196);
this.geometry.ready = true;
}

}

}

Actions Are Overriding Other Actions Or Being Caught In A Loop Only On Double Click
I have a movie which I use actionscript to move things on/off stage to create different pages. Everything works great unless you double click a button.
When double clicking it makes objects "stick" in place and they will not move even though another command should make them move off stage (movie gets stuck). On a single click, the objects do what they are commanded to do. I even tried setting a variable to disable the button click if it has already been clicked. What causes this?

In the code below, the objects in the function home() will not leave the stage once the services button is double clicked (they are commaned to ease off the stage once other mc's are pressed) . BUT it works if only the services mc is only single clicked...please help. I'm pulling my hair on this one and about to start pulling my teeth.


if (_global.whichMovieLoaded != "services" && _global.isMovieLoaded != "stop") {
_global.whichMovieLoaded = "services";
services.onPress = function() {
remove();
function Pause() {
// bring home
home();

clearInterval(PauseInterval);
};

PauseInterval = setInterval(Pause,1000);

valet.easeY(400, 1.09);
itinerary.easeY(425, 1.09);
dining.easeY(400, 1.09);
ground.easeY(425, 1.09);
};
};



function remove(){
valettxt.fadeOut(9);
diningtxt.fadeOut(9);
itinerarytxt.fadeOut(9);
groundtxt.fadeOut(9);

mindtxt.fadeOut(9);
nauticaltxt.fadeOut(9);
scenictxt.fadeOut(9);
terrtxt.fadeOut(9);

mind.easeY(650, 1.09);
nautical.easeY(650, 1.09);
terr.easeY(650, 1.09);
scenic.easeY(650, 1.09);

valet.easeY(650, 1.09);
itinerary.easeY(650, 1.09);
dining.easeY(650, 1.09);
ground.easeY(650, 1.09);

logo.easeX(950);

imageLoader.unloadMovie();

};
//takes objects back to the home page
function home(){
maui.easeX(200, 1.09);
con.easeX(200, 1.09);
bar.easeX(625, 1.09);
patio.easeX(400, 1.00);
patio.fadeIn(2);
discover.easeX(625, 1.09);
discover.fadeIn(1);
imageLoader._alpha = 0;
VIP.fadeIn(.9);
};

Actions On The Main Page..do They Affect Actions On Movie Buttons?
ON the home page I've created, the buttons I used with the code in my previous thread ("two questions about HTML publishing and buttons"), I added an on rollover action to the actions layer of the main timeline (not the movie button timeline) so that on rollover, a picture would change according to the button that was rolled over. I did this for all three buttons. The rollover action works great, but now the links don't work in either the html OR the swf version. Would the added action disable the movie-clip button actions? Here's the added main timeline code, edited for space: photobtn_mc.onRollOver = function() {
gotoAndStop(2);
photobtn_mc.onRollOut = function() {
gotoAndStop(1); ( Again, help is greatly appreciated!)

Actions On Clip Kill Parent Actions? Workaround?
Hello, i have a nav clip, with rollover actions. When the nav clip is rolled over, i want the nav to zoom in. Which isn't a problem,
there are 6 buttons inside the nav clip which have onRelease actions. However, since the nav clip (the parent to the buttons clip) has the rollover state, it kills the actions of the buttons. Is there a workaround for this?

here is my code, the clip structure is nav.buttons.but1 etc.

code:
Stage.scaleMode = 'noScale';
import flash.filters.*;
//------------------------------------------------------------------------------------------------------------------
this.nav.onRollOver = function() {
};
this.nav.onRollOut = function() {
};
//------------------------------------------------------------------------------------------------------------------
for (i=1; i<=6; i++) {
nav.buttons["but"+i].onRelease = function() {
trace(this._name);
};
}

[mx2004] Actions Window Won't Show Actions
Well the problem is rather annoying and stops me from doing any work...

If I open my actions window, it opens up, but I just have a gray area inside the window, I can't put any scripting in, and even funnier, if I try to put my actions window locked into place it will actually crash flash entirely without any error message.

Any help would be much appreciated, thanks in advance!

Copyright © 2005-08 www.BigResource.com, All rights reserved