RSS
email
4

3D rotation of Images using FlashCS3:



Step1: Download Papervision3D_1_5.zip Papervision3D Class Packages - Rev 1.5


Step2: OPen new document: CTRL+N or file open new

Step3: Save files in PV3D_1_5\src folder

Step4: Paste code in first frame of action panel

// import the necessary files..
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;
var container:Sprite=new Sprite();
container.x=stage.stageWidth*0.5;
container.y=stage.stageHeight*0.5;
addChild(container);
this.frameRate=40;
//creating scene basic for papervision; among multiple scenes Scene3D is basic one
var scene:Scene3D=new Scene3D(container);
//camera to see objects
var camera:Camera3D=new Camera3D();
//initial camera zoom is (0,0,0);
//to zoom object into scene..
camera.zoom=5;
//star making planes...
//create material-by attaching bitmap using BitmapAssetMaterial
var bam:BitmapAssetMaterial=new BitmapAssetMaterial("FlashIcon");
//by default material applied to one side of object(here plane);
bam.oneSide=false;
bam.smooth=true;
for (var i:int=0; i<50; i++) {
//new Plane(material,height, width,triangle num,triangle num)---triangle num to control quality
var p:Plane=new Plane(bam,250,150,2,2);
scene.addChild(p);
p.x=Math.random()*1000-500;//gives value from -500 to 500
p.y=Math.random()*1000-500;
p.z=Math.random()*1000-500;
p.rotationY=Math.random()*360;//rotate individual

}
this.addEventListener(Event.ENTER_FRAME,render);
function render(e:Event) {
camera.x+=stage.mouseX-(stage.stageWidth*0.5);
//p.rotationY+=2
camera.y+=stage.mouseY-(stage.stageHeight*0.5);
//to render camera.. to view scene
scene.renderCamera(camera);
}



Note: Code contains explanations..

Important please add an image in stage and give a linkage name for that here we used FlashIcon




SourceFile here
Read more
0

External Interface(flash8):



External Interface(flash8):

Important thing when using external interface in flash to communicate with javascrpt is to..
add allowScriptAccess Parameter in html

To check in local: allowScriptAccess="Always"
To check while hosting: allowScriptAccess="sameDomain"

In MAC OS...Some time external interface will not work local..Host that files to server to work.....
Read more
0

Login to Administrator



Login to Administrator :
Step1: Start-->Run ,type cmd or command



Step2: Type the following in command prompt: at

Step3: Result will be "There are no entries in the list."

Step4: Type the following in command prompt: at 15:43 interactive/ cmd.exe

Note: 15:43 is local system time in 24 hours format, replace with system time..
if your system time is 12.00 type 12.02

Step5: New Command window will be opened at that time..

Step6: In task manager remove explorer.exe

Note: Above step will close all the windows..

Step7: Then close the first opened command prompt.

Step8: Type the following in command prompt: explorer.exe

Step9: WOW you are in ADMIN window...
Read more
6

Iframe Virus:



Last week my system was affected by Mallicious Iframe in all html, php files...
I removed by following steps and posted here...

To remove Iframe virus in (HTML,PHP,ASP,..) files

step1: start->Run type "taskmgr" without quotes.

Step2: Use Task Manager to terminate the worm process (it may be called "spoclsv.exe").

step3: open winrar.exe ...select drive icon in bottom-left corner select c:
there will be setup.exe and autorun.inf
delete this files...



step4: Repeat above step to delete virus in all drives ..

Note:Virus will be hidden and folder option to change hidden files will be corrupted..

step5: Delete the following parameters from the system registry .
[HKCU\Software\Microsoft\Windows\CurrentVersion\Run]
"Svcshare" = "%System%\drivers\spoclsv.exe"

[HKLM\Software\Microsoft\Windows\CurrentVersion\Run]
"Svcshare" = "%System%\drivers\spoclsv.exe"
Note:type "regedit" in Run utility..HKCU(HKEY_CURRENT_USER),HKLM(HKEY_LOCAL_MACHINE)

step6:
Delete the following file:
C:/WINDOWS/system32/drivers/spoclsv.exe

step7: Download and install Ravmon Removal.exe to restore settings


step8: Restart..and download and install Antivirus kaspersky trial..
Read more
3

Drawing Dynamic object in flash cs3:



Code:

import flash.display.Sprite;
import flash.events.Event;
var spr:Sprite=new Sprite();
spr.graphics.beginFill(0xFF00FF,1);
spr.graphics.drawRect(100,100,200,200);
spr.graphics.endFill()
spr.name="sara";
spr.addEventListener(MouseEvent.CLICK,sarafun);
addChild(spr)
function sarafun(event:MouseEvent){
trace(event.target.name);
}


Explanation:

Sprite:
Derived from DisplayObject Class..
Lightweight..
Similar to movieclip but contains single frame or no timeline..

var spr:Sprite=new Sprite();

this is to create dynamic sprite..

Note:Similar to create empty movleclip


spr.graphics.beginFill(0xFF00FF,1);
spr.graphics.drawRect(100,100,200,200);
spr.graphics.endFill()

here how to create drawing objects...
Many ways like drawCircle(),drawEllipse()..,

spr.addEventListener(MouseEvent.CLICK,sarafun);
here we are adding listener...to object...more like

Note:
onpress=onrelease=MouseEvent.CLICK
onmousedown=MouseEvent.MOUSE_DOWN
onmouseup=MouseEvent.MOUSE_UP
soon..

addChild(spr);
here we are adding sprite to the display list...

Note:there is no need to specify depth since it manages itself
Read more
3

Preloading in FlashCS3



Started learning flash CS3..so i sharing what i learnt...
this is to preloading in cs3...

full code:
import flash.display.Loader;
import flash.net.URLRequest;
var url:String='http://greetings.visualenc.com/shockwave/friends3.swf?cachebusters='+new Date().getTime();
var loader:Loader=new Loader();
loader.contentLoaderInfo.addEventListener(Event.OPEN,loadinit);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,loading);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completes);
loader.load(new URLRequest(url))
addChild(loader)
function loadinit(event:Event){
trace("::::Started::::");
}
function loading(event:ProgressEvent) {
trace((event.bytesLoaded/event.bytesTotal)*100);
}
function completes(event:Event){
trace("::::complete::::")
}



import flash.display.Loader;
import flash.net.URLRequest;

This is loading the necessary packages...for loader class and url request



var url:String='http://greetings.visualenc.com/shockwave/friends3.swf?cachebusters='+new Date().getTime();

string contains the url to be loaded..

that new Date().getTime()..is not new feature. when added to url files will not be cached...or no need to clear cache for new updated file..



var loader:Loader=new Loader();
Creating Object for loader class...Loader class is to load image and swf files into flashCS3



loader.contentLoaderInfo.addEventListener(Event.OPEN,loadinit);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,loading);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completes);

Adding listeners ..similar to MovieClipLoader in flash8.




loader.load(new URLRequest(url))

loading external content into loader object via url request class...



trace((event.bytesLoaded/event.bytesTotal)*100);

here we calculate the bytes loaded...
Read more
 

Recent Posts

Recent Visitors

Donate Me

About Me

My photo
Chennai, Tamil nadu, India
Nothing more to say about me.. Just a Action Script programmer / Flex developer having 4.5 years of experience.