Favorites
Show All / Manage

You have no favorites.


Page 1 of 1
User avatar
Villager
Hey guys! I could use some help here

I'm using flash cs6 and in an attempt to make one of our animations look more 3D I changed some of the objects 3D positions. I did this by changing the Z value of the objects in the "3D positioning and view" in the properties section (The objects I'm talking about are the boxes btw).

This worked very well when I exported it to SWF but when I tried to export it into an mp4 using swivel, it didn't work at all

Here's what it looks like


SWF
http://sta.sh/018guoh0eju9

mp4


See the difference? :(
any ideas as to how I can fix this?

User avatar
Monk
There are definitely some obscure features in flash that swivel doesn't render properly, but there's often workarounds. In your case I'd just classic tween it all manually. If you're doing some intense stuff and need it then program the 3D tool yourself so Swivel can see it. I could tell you how but first you would need to tell me exactly what you need to achieve with it.


User avatar
Villager
HeartOfTheStorm wrote:
There are definitely some obscure features in flash that swivel doesn't render properly, but there's often workarounds. In your case I'd just classic tween it all manually. If you're doing some intense stuff and need it then program the 3D tool yourself so Swivel can see it. I could tell you how but first you would need to tell me exactly what you need to achieve with it.

Thanks for the response @HeartOfTheStorm. I'd prefer to program the 3D tool if possible. It's not really too intense, the whole animation is roughly 40 seconds and the boxes don't move at all throughout the animation, just the vcam going from side to side and zooming in and out. So yeah, that's all there is to it for this animation. Where do I start?

User avatar
Monk
Oh sick I actually programmed something for that in the past
1. Combine all things which move at the same velocity by converting them to a single movieclip (F8) (graphics symbols cannot be moved with code). All movieclips can be on same layer
2. Click on the farthest box movieclip, in the properties give it a unique instance name like box1_MC, do this for all.
3. Also click on your vcam and name it vCam_MC
4. Click a frame when the box movements begin, can be any layer of your main timeline, open the action panel (F9). Paste this:
Code:
stage.addEventListener(Event.ENTER_FRAME, ticker1);
var vCamOgX:Number = vCam_MC.x;
var vCamOgY:Number = vCam_MC.y;
var box1OgX:Number = box1_MC.x; //box1_MC has to exist onstage or else this code gives an error
var box1OgY:Number = box1_MC.y;
var box2OgX:Number = box2_MC.x;
var box2OgY:Number = box2_MC.y;
var box3OgX:Number = box3_MC.x;
var box3OgY:Number = box3_MC.y;
function ticker1(e:Event){
   vCamTrack();
}
function vCamTrack():void{
   if (currentFrame > 0 && currentFrame <= 91){ //specify range which you want the objects to move in, currentFrame is # of frame plus frames of preceding scenes
      box1_MC.x = box1OgX+(vCam_MC.x-vCamOgX)*0.75; //farthest object, moves box to original position plus 75% the distance vcam moved from its origin
      box1_MC.y = box1OgY+(vCam_MC.y-vCamOgY)*0.75;
      box2_MC.x = box2OgX+(vCam_MC.x-vCamOgX)*0.5;
      box2_MC.y = box2OgY+(vCam_MC.y-vCamOgY)*0.5;
      box3_MC.x = box3OgX+(vCam_MC.x-vCamOgX)*0.25; //closest object
      box3_MC.y = box3OgY+(vCam_MC.y-vCamOgY)*0.25;
   }
}

5. (Optional) You probably don't want to do the blur with code, but if you did the final code would look loosely like this:
Code:
stage.addEventListener(Event.ENTER_FRAME, ticker1);
var vCamOgX:Number = vCam_MC.x;
var vCamOgY:Number = vCam_MC.y;
var box1OgX:Number = box1_MC.x; //box1_MC has to exist onstage or else this code gives an error
var box1OgY:Number = box1_MC.y;
var box2OgX:Number = box2_MC.x;
var box2OgY:Number = box2_MC.y;
var box3OgX:Number = box3_MC.x;
var box3OgY:Number = box3_MC.y;
var box1Blur:BlurFilter = new BlurFilter(12,12,3); //(x blur, y blur, quality) (quality 1 is low, 3 is high, can go higher than 3)
var box2Blur:BlurFilter = new BlurFilter(9,9,3);
var box3Blur:BlurFilter = new BlurFilter(6,6,3);
function ticker1(e:Event){
   vCamTrack();
}
function vCamTrack():void{
   if (currentFrame > 0 && currentFrame <= 91){ //specify range which you want the objects to move in, currentFrame is # of frame plus frames of preceding scenes
      box1_MC.x = box1OgX+(vCam_MC.x-vCamOgX)*0.75; //farthest object, moves box to original position plus 75% the distance vcam moved from its origin
      box1_MC.y = box1OgY+(vCam_MC.y-vCamOgY)*0.75;
      box2_MC.x = box2OgX+(vCam_MC.x-vCamOgX)*0.5;
      box2_MC.y = box2OgY+(vCam_MC.y-vCamOgY)*0.5;
      box3_MC.x = box3OgX+(vCam_MC.x-vCamOgX)*0.25; //closest object
      box3_MC.y = box3OgY+(vCam_MC.y-vCamOgY)*0.25;
      box1_MC.filters = [box1Blur]; //enables blur
      box2_MC.filters = [box2Blur];
      box3_MC.filters = [box3Blur];
   } else {
      box1_MC.filters = []; //disables blur
      box2_MC.filters = [];
      box3_MC.filters = [];
   }
}

Make sure you mess with the values to make it look the way you want. If you want a background to be infinitely far away just make it into another object and make it move 1:1 with the vcam. If you have like 30 independent boxes then look into making automated arrays. I used a method similar to this to make a randomly generated sphere of objects which get automatically smaller and blurrier as they get farther away. In case you care this was its code:
Make sure the there are 3 movieclips named cartGreen_MC, cartWhite_MC, and cartBlue_MC on the stage or else it won't run. The only other thing you need is a movieclip in the library, right click>properties and use advanced options to export for actionscript as circObj
Code:
stop();

var countDeg:Number=0;
var g:Graphics=this.graphics;
const SHEIGHT:int=stage.stageHeight;
const SWIDTH:int=stage.stageWidth;
const XMID:Number=SWIDTH/2;
const YMID:Number=SHEIGHT/2;
var phiTo:Number=0;
var xTo:Number=0;
var yTo:Number=0;
var xBlur:Number=0;
var yBlur:Number=0;

/*Circles creation*/
var numCirc:int=90; //init # circs
var sizeCirc:int=90;

var bullF3:MovieClip;
var bulletHoldF1:MovieClip;
bulletHoldF1=new MovieClip  ;
this.addChild(bulletHoldF1);
var bulletArrF1:Array;
bulletArrF1 = new Array();

/*Sphere creation*/

var sphereWid:int=410; //init width
var ptXArr:Array = new Array();
var ptYArr:Array = new Array();
var phiArr:Array = new Array();



for (var i:int=0; i<numCirc; i++) {
   ptYArr.push(2*sphereWid*Math.random()-sphereWid);//(max-min)*rand+min
   ptXArr.push(Math.sqrt(Math.pow(sphereWid,2)-Math.pow(ptYArr[i],2)));//width at height
   phiArr.push(360*Math.random());//phi is 0 to 360
   fireBullet();
}
addEventListener(Event.ENTER_FRAME, onEnterFrame);

function onEnterFrame(e:Event) {
   countDeg+=1;
   if (countDeg==360){
      countDeg == 0;
   }
   g.clear();
   g.lineStyle(1, 0xCC0066);
   for (var i:int=0; i<numCirc; i++) {
      //g.moveTo(XMID, YMID);
      phiTo = countDeg+phiArr[i];
      xTo=XMID+ptXArr[i]*Math.sin(toRad(phiTo));//W*sin(count+rand(phi)+center)
      yTo=YMID+ptYArr[i];
      //g.lineTo(xTo,yTo);
      //cool error://g.lineTo(XMID + 100*Math.sin(toRad(ptXArr[i]+countDeg)),YMID+ptYArr[i]);
      moveBullet(bulletArrF1[i], xTo, yTo, phiTo, ptXArr[i]);
   }
   vibrateCarton();
}
function toRad(deg:Number):Number {
   return (deg/180*Math.PI);
}
function fireBullet():void {
   var bulletF1=new circObj  ;
   bulletArrF1.push(bulletF1);
   bulletF1.height=sizeCirc; //unneeded init, remove sizeCirc variable after removing
   bulletF1.width=sizeCirc;
   bulletF1.alpha=0.2;
   bulletHoldF1.addChild(bulletF1);
   bulletHoldF1.setChildIndex(bulletF1,0);
}
function moveBullet(thisBullet, xLoc:Number, yLoc:Number, phiLoc:Number, xLocWidth:Number):void {
   thisBullet.x = xLoc;
   thisBullet.y = yLoc;
   thisBullet.width=sizeCirc+(16*Math.sin(toRad(phiLoc-90)));
   thisBullet.height=sizeCirc+(16*Math.sin(toRad(phiLoc-90)));
   xBlur = Math.abs(xLocWidth/sphereWid*19*Math.sin(toRad(phiLoc-90))); //APPLY DEPTH AT HEIGHT, xLocWidth has a max value of sphereWid
   yBlur = Math.abs(xLocWidth/sphereWid*19*Math.sin(toRad(phiLoc-90)));//
   var circBlur:BlurFilter = new BlurFilter(xBlur,yBlur,4); //(x,y,qual)
   thisBullet.filters = [circBlur];
}
function vibrateCarton():void {
   cartWhite_MC.x = XMID+4*Math.random()-2
   cartWhite_MC.y = YMID+4*Math.random()-2
   cartBlue_MC.x = XMID+20*Math.random()-10
   cartBlue_MC.y = YMID+20*Math.random()-10
   cartGreen_MC.x = XMID+20*Math.random()-10
   cartGreen_MC.y = YMID+20*Math.random()-10
   
}
Running this for 5 seconds crashes my flash lol, my computer must be decaying


User avatar
Villager
Thanks a lot! much appreciated! :D it looks like it's working

Page 1 of 1
Search for:

Oh dear. Looks like there was a problem.
You are using a browser that doesn't support the technology this website uses.

Don't fret. There are solutions.

Oh dear. Looks like there was a problem.
You are using a version of Internet Explorer that this site doesn't support.

Don't fret. There are solutions.