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




Conversion Problem



How to convert a string "0xff0000" to a Number?



FlashKit > Flash Help > Flash ActionScript
Posted on: 04-29-2004, 02:29 AM


View Complete Forum Thread with Replies

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

Conversion
how do I "convert" movie clips into buttons and vice versa.. do I just change the instance ?

Conversion From 5 To MX
Ok, I started my project with flash 5. Then I upgraded to MX. Used a feature I guess only works in MX. Now, it's giving me an error saying that I'm using something that will not work on flash 5. I am not using flash 5. Now the tool tip that I placed in my page is not working because of this error. So what can I do?

5.0 To MX Conversion
I'm involved in a project where flash is used to generate pie charts, bar graphs, line charts, etc. on the fly from a querystring. The files were built in 5.0 and I'm told worked fine. When going to MX however, some of the charts and graphs stopped working. The information I was able to obtain suggested changing all the "eval" statements to "this." I did that, but with no success.

If any actionscript gurus out there are interested in working on the project please email me. You will be paid for your efforts.

Thanks,
Dave
toonman@toonman.com

Gif Conversion
Could someone show me how to convert a swf file into a gif file please for the use of link exchange?

Swf To Dxf Conversion
Hello,

Does anyone out there know how to convert a swf file (i.e. floor plan movie clip) to dxf format to be incorparted into a cad program?

Thanks

Martin

Mac To Pc Conversion
I work on macs at work and want to take my fla's home but I can't open them because I am on a PC at home. Is there anyway of converting to pc format?

Conversion?
Is there a way i can change an inut text into a dynamic text through action script?

BPM To FPS? Conversion?
does anyone have the equation for converting bpm to fps???


thank you soooo much in advance!!

AS2.0 Conversion
Okay I've got this pet project that is pretty cool. I'll explain it to you and it should be attached below. It takes a date and runs it through all of these functions to determine the Chinese Taoist Four Pillars of the date and time. The four pillars are where we typically get our idea of the Chinese Animal years from. Actually the Chinese Animals are only one half of one pillar. This app basically goes and calculates all four pillars.

So I spent months doing it on the side and finally got it to a working condition, but I did it all in AS1. It isn't useless now but I'd really like to see it updated for AS2.0. I was hoping there was some 2.0 god out there who would want to take on a challenge. I've only attached the swf so you can see it in its current state. If you're interested send me a message and I'll send you the fla.

Thanks in advance.

Vob Conversion
I need to convert a vob file to either have it as a link to play or upload to flash. I have tried a few DVD rippers but nothing works right. Any ideas how to take a DVD file ending with .vob and make it a file you can view on the web? Or for flash to upload, compress and play

.swf Conversion?
Is there any way to edit a .swf file? not to steal anybody's work or anything, but to edit a cartoon I made a while back and kept the .swf but not the .fla Thanks for any help you can provide

I Need Something For An SWF To DVD Conversion
Does anybody know of any Flash SWF to a DVD or VCD file converter???

FLV Conversion
Is there a way to make a swf into a flv?

or

When I try to publich as quicktime format, I get an error message telling me that my version of quicktime is not capable of exporting ???


I need either to do the conversion or find a tutorial of publishing in MOV format.

AS 1.0 To AS 2.0 Conversion
hello, can anyone help me to convert this script from AS1.0 to AS2.0:

AS 1.0 works, but AS 2.0 shows an error in this line "2:flexb = Number(flex)+Number(tracerx);".

I dont know how to fix it ....
thanks

2:flexb = Number(flex)+Number(tracerx);
j = 3;
while (Number(j)<32) {
set(j add ":flexb", eval(j-1 add ":flexa"));
setProperty(j, _x, eval(j add ":x")+Eval(j add ":flexb"));
j = Number(j)+1;
}
x1 = x2;

[MX] SWF To 3GP Conversion
Hello there

I've been looking for ages now for a program (not necessarily free - just one that does the job) that will 100% convert SWF files to 3GP files for usage on mobile devices.

I've used ANVSOFT's converter but for whatever reason it doesn't seem to like nested movie clips.

Can anyone help/suggest a resource ?

Thanks in advance

SWF To AVI Or QT Conversion?
Hello:
I have an swf file I need to convert to an avi or qt for use in adobe encore for a dvd authoring class. Does anybody know a good way to do this without additional software?

I tried just exporting it but I have a lot of animation embedded in movie clips and when it is exported the movie clips do not have the animation.

Hopefully this makes sense and if so any help would be greatly appreciated.

thanks

As2 To 3 Conversion Help
hi there

I'm converting a little timer that i found here on flashkit to as3 i have managed to fix all the errors however the clock is still not running. there is a text field with the instance name "clock" which looks like "00:00:00:00" here is the current code


Code:
var startTime;
var elapsedTime;
var elapsedHours;
var elapsedM;
var remaining;
var seconds;
var hundredths;
var elapsedS;
var elapsedH;
var hours;
var minutes;



this.addEventListener("enterFrame",onEnterFrame);
function onEnterFrame(e:Event) {
startTime = getTimer();
elapsedTime = getTimer()-startTime;
elapsedHours = Math.floor
(elapsedTime/3600000);
remaining = elapsedTime-(elapsedHours*3600000);
elapsedM = Math.floor(remaining/60000);
remaining = remaining-(elapsedM*60000);
elapsedS = Math.floor(remaining/1000);
remaining = remaining-(elapsedS*1000);
elapsedH = Math.floor(remaining/10);
if (elapsedHours<10) {
hours = "0"+elapsedHours.toString();
} else {
hours = elapsedHours.toString();
}
if (elapsedM<10) {
minutes = "0"+elapsedM.toString();
} else {
minutes = elapsedM.toString();
}
if (elapsedS<10) {
seconds = "0"+elapsedS.toString();
} else {
seconds = elapsedS.toString();
}
if (elapsedH<10) {
hundredths = "0"+elapsedH.toString();
} else {
hundredths = elapsedH.toString();
}

var clock:String = hours+":"+minutes+":"+seconds+":"+hundredths;

}
can somebody point me in the right direction please

[CS3] XML Conversion From As3 To As2
How would I read in the following xml file using actionscript 2? I can do it using as3, but not as2


PHP Code:




<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<users>
   <user="1" company="1"/>
   <user="2" company="2"/>
   <user="3" company="3"/>
</users>






this is the code i would use for as3:


PHP Code:




u = this.childNodes[0].firstChild.@user;
c = this.childNodes[0].firstChild.@company;







in as2, it doesn't like the @ symbol. is there an alternative for as2?

Conversion
Hi guys,

This code is working on Flash 4 but not on newer version and I want to use it on Flash 8, so can anyone help me


Code:
eval("y" + i) = getProperty("/p" + (1 + (i - 1) * numCols), _y);
thanx in advance

Swf To FLV Conversion
Would anyone be able to recommend an app for swf to FLV conversion that can accommodate batch processing?

I’ve looked at a number of products and it seems the swf to video conversion is not handled very gracefully. By this I mean, in the 4-5 applications I’ve tested, the conversion is not direct – the user would first have to convert their swf to a format like AVI, or a QuickTime Movie, and then convert to FLV. What I’ve observed is that the apps actually grab/record the users’ desktop for the duration of the runtime of the swf and from that produce the resulting file. The apps have crop settings that allow the user to set the resulting files stage size to that of the swf being recorded, eliminating excess from showing up in the final file.

I guess the process they use is ok for one off’s, but in situations where batch processing needs to be employed this wont work simply because the stage size for the files being duplicated all vary. None of these apps allow for a dynamic adjustment of that very important setting.

So I’m left here wondering if anyone produces conversion apps that function in much the same way the conversion apps for video to FLV do.

Anyone have advice?

Thanks.

Conversion To AS2
Hi I'm only an occasional flash user and I've built up a library of scripts as my knowledge is minimal. My question is: could someone help me convert one small piece of old ActionScript as I need it to work in Flash Player 7 or higher at the moment it only works with 6.
This is the code in two parts:
Frame action:

Code:
Movieclip.prototype.elasticMove = function(target, accel, convert) {
step = step*accel+(target-this._x)*convert;
this._x += step;
};
Movie Clip/Button action:

Code:
onClipEvent (enterFrame) {
elasticMove(_root.newX, 0.4, 0.2);
}
onClipEvent (load) {
_root.newX = -1680.0;
}
I may have got the code here years ago but I forget. It basically just allows a movie clip's position on the stage to be set with an elastic and easing action.

Thanks for any help.

FLV Conversion
thanks for the quick reply but got this error:

1119: Access of possibly undefined property g through a reference with static type flash.displayisplayObject.

any ideas? thanks

Conversion Help
Hi guys i am having trouble converting this code to actionscript 3...is there any one that can help me?



Code:


var lvSend:LoadVars = new LoadVars();
var lvReceive:LoadVars = new LoadVars();

tError.autoSize = "right";

mcLogin.onRelease = function() {
lvSend.email = tEmail.text;
lvSend.password = tPassword.text;
lvSend.sendAndLoad("logincheck.php", lvReceive, "POST");
};

lvReceive.onLoad = function(success:Boolean) {
if (success) {
if (this.login == "success") {
getURL("members.php");
} else {
tError.text = "I'm sorry you did not enter valid login details";
}
} else {
trace("no reponse from server");
}
};

/*

var lvSend:LoadVars = new LoadVars();
var lvReceive:LoadVars = new LoadVars();

tMessage.autoSize = true;
mcAge.tInput.restrict = "0-9"; //as trying to put a none-integer in age column in mySQL will cause an error

mcRegister.onRelease = function() {
var valid:Boolean = validateForm();

if(valid){
//gather information and put in loadvars object
lvSend.firstname = mcName.tInput.text;
lvSend.surname = mcSurname.tInput.text;
lvSend.age = mcAge.tInput.text;
lvSend.email = mcEmail.tInput.text;

//send information php script for insertion into database
lvSend.sendAndLoad("registration.php", lvReceive, "POST");
}else{
alert("Please complete all fields");
}
};

lvReceive.onLoad = function(success:Boolean) {
if (success) {
if(this.result == "emailExists"){
alert("This email address already exists in the database. Please choose another");
}else if (this.result == "success") {
tMessage.text = "Thank you for registering. Your password has been sent to your email address";
clearTextFields();
} else {
tMessage.text = "I'm sorry there has been an error with your registration";
}
}
};



function validateForm():Boolean{
if(mcName.tInput.text == "" || mcSurname.tInput.text == "" || mcAge.tInput.text == "" || mcEmail.tInput.text == ""){
return false;
}
return true;
}


function clearTextFields():Void{
mcName.tInput.text = "";
mcSurname.tInput.text = "";
mcAge.tInput.text = "";
mcEmail.tInput.text = "";
}




//function which give javascript alerts -- convenient for debugging when playing movie in a browser
//or even just alerting the user with javascript prompts when needed.
function alert(message:String):Void{
getURL("javascript:alert('"+message+"');");
}

AS2 To AS3 Conversion
I was wondering if someone could maybe help convert this into AS3. I've posted this before a while back but no one responded. I've considered using !== logical negation instead of using <> but that didn't get me far. Im still missing the concept of setting up the functions and variables for AS3. ANY help would be most appreciated.


ActionScript Code:
function bgmove(){
    bg_mc.onEnterFrame=function(){
        if(this._x<>Math.round(xpos[pos])&&this._y<>Math.round(ypos[pos])&&this._xscale<>Math.round(wpos[pos])&&this._yscale<>Math.round(hpos[pos])){
            this._x+=Math.round((xpos[pos]-this._x))/deceleration;
            this._y+=Math.round((ypos[pos]-this._y))/deceleration;
            this._xscale+=Math.round((wpos[pos]-this._xscale))/deceleration;
            this._yscale+=Math.round((hpos[pos]-this._yscale))/deceleration;
            this._rotation+=Math.round((rpos[pos]-this._rotation))/5;
        }else{
            this.onEnterFrame=null;
        }
    }
    bg2_mc.onEnterFrame=function(){
        if(this._x<>Math.round(xpos[pos])&&this._y<>Math.round(ypos[pos])&&this._xscale<>Math.round(wpos[pos])&&this._yscale<>Math.round(hpos[pos])){
            this._x+=Math.round((xpos[pos]-this._x))/15;
            this._y+=Math.round((ypos[pos]-this._y))/15;
            this._xscale+=Math.round((wpos[pos]-this._xscale))/15;
            this._yscale+=Math.round((hpos[pos]-this._yscale))/15;
            this._rotation+=Math.round((rpos[pos]-this._rotation))/5;
        }else{
            this.onEnterFrame=null;
        }
    }
}

One More Conversion From AS 2.0 To 3.0
I think I'm going to need some more help with this whole conversion thing... I was looking through some of my old Flash files to find an effect I could use in this new site I'm building and found a sweet one I can't pass up... it fits perfectly into the new site.

Last time I asked for conversion help, instead of getting an AS file, I got some script to plugin directly to the timeline... and it worked like a charm. Only problem was that it was very processor/memory demanding. So my first question is... if I use an AS external file (which I have very little knowledge of) will it perform better than if I plug the code into the timeline?

Next question... can someone help me convert this code into AS 3 please?



ff_x=400;// x possition of glowing orbs
ff_y=150;// y possition of glowing orbs
ff_width=100;// width of glowing orbs
ff_height=100;// height of glowing orbs

orbs = function(maxF) {
this.createEmptyMovieClip("orbs_mc",this.getNextHi ghestDepth());
orbs_mc._x=ff_x;
orbs_mc._y=ff_y;

orbs_mc.attachMovie("orbs", "f", orbs_mc.getNextHighestDepth());
no_f=1;

duplicateOrb = function(){
orbs_mc.f.duplicateMovieClip(["f"+no_f], no_f);
orbs_mc["f"+no_f]._x=Math.random()*ff_width-ff_width/2;
orbs_mc["f"+no_f]._y=Math.random()*ff_height-ff_height/2;
orbs_mc["f"+no_f]._alpha=Math.random()*100;
orbs_mc["f"+no_f]._rotation=Math.random()*360;
//orbs_mc["f"+no_f]._xscale=orbs_mc["f"+no_f]._yscale=Math.random()*100; // scale orb
no_f++;
if(no_f>maxF) clearInterval(orbsID);
}
orbsID = setInterval(duplicateOrb, 100);
}

orbs(25); // add 25 orbs


If you can give me AS 3 code I can plug into a layer on my timeline, that would be most excellent!

Thank you so much!

AS2 To AS3 Conversion
I'm in the process of converting external classes that I used for AS1 and AS2 to AS3 and I've run into several problems.

I'm not sure how to fix the following compile error:
TimerDelay.as, Line 12
1067:Implicit coercion of a value of type String to an unrelated type Number


ActionScript Code:
/**
**  Timer class for controlling events.
**/
function TimerDelay(callBackTarget, callBackFunction){
    this.callBackTarget     = callBackTarget;
    this.callBackFunction   = callBackFunction;
};
TimerDelay.prototype.startTimer = function(delayAmount){
    this.stopTimer();
   
    var timeDelay = delayAmount * 1000;
    this.timerInterval = setInterval(this, "callFunction", timeDelay);//Problem script
};
TimerDelay.prototype.stopTimer = function(){
    clearInterval(this.timerInterval);
};
TimerDelay.prototype.callFunction = function(){
    this.stopTimer();
    this.callBackTarget[this.callBackFunction]();
};

I'm not the greatest AS2 programmer let alone AS3. Any help would be appreciated.

AS2 To AS3 Conversion
Hello all,

I found a movie on Flashkit.com but I can not use it in the movie i creating in CS3. Can someone please assist me in converting this to AS3? Thanks!

Here is the AS:


ActionScript Code:
// ActionScript 2.0 Mute/Sound Toggle Fader Button.
// Note this dosn't stop sound, only sileance it.



onClipEvent (load)
{
    _root.soundstatus = "on";

    _root.mySound = new Sound(_root.soundbutton); // Create Var for our sound file
    // Notice this MC Instance name here.
// To control your soundtrack independently it needs to be placed in a separate MC which is -
// addressed by its Instance Name. In order for this to work All of your audio background sounds -
// or FX should be in Separate MCs and not on the timeline and called to play and controlled via ActionScript.


   
    _root.mySound.attachSound("MySoundTrack"); // LINK ID Name - Change your name here to the Linkage ID.
    _root.mySound.start(0,1000); //Start and Loop your sound file
   
   
   
    maxvolume = 100;
    minvolume = 0;
}





onClipEvent (enterFrame)
{
    if (_root.soundstatus == "on")
    {
        step = 5;
    } // end if
   
    if (_root.soundstatus == "off")
    {
        step = -5;
    } // end if
   
   
    maxvolume = maxvolume + step;
    if (maxvolume > 100)
    {
        maxvolume = 100;
    } // end if
   
   
    if (maxvolume < 0)
    {
        maxvolume = 0;
    } // end if
   
   
    _root.mySound.setVolume(maxvolume);
   
   


}
Button

ActionScript Code:
on (release)
{
    _root.soundstatus = "off";
    gotoAndPlay(2);
}

Conversion AS2 --> AS3
Hi this is a question in between both AS2 & AS3 so I didn't know where to put it exactly.
I have very nice simple script in AS2 (not mine I have found it on cleverpig.com) it generates nice 3D starfield.
My problem is that I would like to have it in AS3 instead AS2 I've been trying for a while to rewrite it myself but I am still a newbie in AS and just can't do it.

Please have a look below I post both working AS2 version and mine AS3 which isn't really working yet as original. Please can you give me some hints at least what to do.

AS2 Working

ActionScript Code:
// script and comments by CleverPig ([url]www.cleverpig.com[/url])
//expects a 600x300 stage with a dark background colour
//
// depth of the picture plane...
_global.ppDist = 500;
_global.speed = 5;
//update function to handle perspective projection and scaling
update = function ()
{
    perspective = ppDist / (ppDist - this.z);
    this._x = this.x * perspective;
    this._y = this.y * perspective;
    this._xscale = this._yscale = 100 * perspective;
    // add z motion...
    this.z += speed;
    // push back when it reaches the view position...
    if (this.z > 490)
    {
        this.z -= 2000;
    }
}
//empty clips for drawing...
_root.createEmptyMovieClip ("drawing", 1);
_root.drawing.createEmptyMovieClip ("sq", 1);
// centre the 'drawing' mc on the stage...
_root.drawing._x = 300;
_root.drawing._y = 150;
// draw a solid white 4x4 square in the 'sq' mc
_root.drawing.sq.beginFill (0xffffff, 100);
_root.drawing.sq.moveTo (-2, -2);
_root.drawing.sq.lineTo (2, -2);
_root.drawing.sq.lineTo (2, 2);
_root.drawing.sq.lineTo (-2, 2);
_root.drawing.sq.lineTo (-2, -2);
_root.drawing.sq.endFill ();
// hide the original 'sq' off stage
_root.drawing.sq._y = 1000;
// make 198 copies of the square
for (i = 2; i < 400; i++)
{
    initOb = {x:random (600) - 300, y:random (300) - 150, z:random (2000) - 1600};
    //note: random(600)-300 gives a random integer between -300 & 299
    //note: random(2000)-1600 gives a random integer between -1200 & 399
    _root.drawing.sq.duplicateMovieClip ("s" + i, i, initOb);
    _root.drawing["s" + i].onEnterFrame = _root.update;
}


AS3

ActionScript Code:
var dimX:Number = stage.stageWidth/2;
var dimY:Number = stage.stageHeight/2;
var ppDist:Number = 500;
var speed:Number = 30;

for (var i:uint = 0; i < 30; i++) {
    var posX:Number = Math.random()*dimX*2-dimX;
    var posY:Number = Math.random()*dimY*2-dimY;
    var posZ:Number = Math.random()*2000-1600;

    var mcStars:Sprite = new Sprite();
    var star:Graphics = mcStars.graphics;
    star.beginFill(0xFF0000);
    star.drawCircle(posX ,posY ,2);
    star.endFill();
    addChild(mcStars);

    var perspective = ppDist / (ppDist - posZ);
    this.scaleX = this.scaleY = 1 * perspective;

    root.addEventListener(Event.ENTER_FRAME, Update, false, 0, true);
}

function Update(evt:Event):void {

    var perspective = ppDist / (ppDist - posZ);
    this.x = posX * perspective;
    this.y = posY * perspective;
    this.scaleX = this.scaleY = 1 * perspective;

    posZ += speed;
    if (posZ > 490){posZ -= 2000;}
}

Regards
Dave

Mx Conversion
can someone convert these into FLASH MX for me please? like to see how they work.

Swf To Avi Conversion
Since my Flash MX Pro refuses to export my project with embedded video to .avi, I am thinking about using some third party conversion tool to convert .swf to avi...Know any ? Thanx

WMF/EMF To SWF Conversion...
I need an API that can convert WMF/EMF to SWF for a program I am writing. I am writing said program in C#, so a .NET library would be nice, but COM is acceptable also. Any ideas?

FLV Conversion
I have a FLA with frame by frame animation using 100 keyframes of bmps which resulted in a big swf file, 1.8M. I would like to output into a flv file hoping it would recude the swf file size for the web application. Help!

.wmv Conversion
Want to put video on web for the first time. Need to convert .wmv to flash. Will Flash do the conversion or what else to use?
Don't have Flash yet, should I wait for Flash 9??
What say you??

DVD To SWF Conversion
I need to convert videos I am given on DVD to SWFs. I would also like to be able to trim away unwanted parts of the video.

I see that there are plenty of utilities for this and I was wondering if anyone had any suggestions/recommendations.

P.S. The trick of changing the vob extension to mpg and bringing it through the Flash video encoder doea not work.

Thanks in advance.

Art

Mpg To Flv Conversion
Best method for .mpg to .flv conversion? I have the Master Collection CS3,
but I still have to download an flv converter tool???

XML Conversion
Can anyone spor the error n this code?

function xmlLoaded(event:Event):void {
var classXML:XML = new XML()
classXML = XML(event.target.data)
trace("Data loaded."+classXML+"---"+event.target.data);
gotoAndPlay("loadMarks")
}

The output of the trace is:

Data loaded.---<?xml version="1.0" encoding="utf-8"?>
<allclasses>
</allclasses>

Whcih dose not display classXML but does dispaly the correct event.target.data

XML Conversion
Can anyone spot the error in this code?

function xmlLoaded(event:Event):void {
var classXML:XML = new XML()
classXML = XML(event.target.data)
trace("Data loaded."+classXML+"---"+event.target.data);
gotoAndPlay("loadMarks")
}

The output of the trace is:

Data loaded.---<?xml version="1.0" encoding="utf-8"?>
<allclasses>
</allclasses>

Whcih dose not display classXML but does display the correct event.target.data.

As2 To As3 Conversion
how can i convert that to as3







Attach Code

setSelected = function (file) {
this.upload_btn.visible = true;
this.mc_selectDiff.visible = true;
selected_file = file;
file_name.text = file.name;
}

Conversion
can any one please help me make this following html script work in flash:
<form action="/cgi-sys/guestbook.cgi" target=guestwindow>
<input type="hidden" name="user" value="sreeapqy">
<input type="hidden" name="action" value="addguest">
<input type="hidden" name="basehref" value="http://sreenadh.shyper.com">
<input type="hidden" name="template" value="default">
Name: <input type="text" name="name"><br>
Email: <input type="text" name="email"><br>
Url: <input type="text" name="url"><br>
Comments: <textarea name="comments"></textarea><br>
<input type="submit" value="Sign Guestbook">
</form>

AVI -> FLV Conversion
Hey gang, what software do you guys recommend for this kind of conversion?

Thanks!

-joe.

Conversion Help
I have a file that someone posted to the MX2004 forum. I edited it in 8 and saved back to 2004 but it turns out they have MX not 2004. Can someone please convert it to MX for me? Here is the link...

http://www.junkerjorg.com/edits/RaveFinalMix4.zip

Thanks in advance!

Help Please, Need A Conversion.
I need this turned into MX 2004 format quickly (Within the next half hour or so)
Can anyone help me?

http://www.sharebigfile.com/file/95798/Proj-fla.html

Conversion AS 2.0 => AS 3.0
I recently purchased Flash CS3 and I was surprised to see that when I initially compiled my movie, none of the actions worked - in fact, several errors occurred.

I then realized I was compiling under AS3.0 document setting and compiler 9.0
My question is, I know this is "dirty" of me to ask such a favor, but this is the only way I really can learn... Is it possible for anyone to do even at least a pseudo conversion of my original AS2.0 code, let alone a full conversion?


Code:
radHitTest = function(obj1,obj2,rad) {
if ((Math.sqrt(Math.pow(obj1._x-obj2._x,2)+Math.pow(obj1._y-obj2._y,2)))<
((obj1._width+rad)/2 + obj2._width/2))
return true;
else
return false
}

circleHitTest = function(obj1,obj2) {
if ((Math.sqrt(Math.pow(obj1._x-obj2._x,2)+Math.pow(obj1._y-obj2._y,2)))<
(obj1._width/2 + obj2._width/2))
return true;
else
return false
}

createZergling = function () {
var unit = _root.attachMovie("zergling", "zergling", _root.getNextHighestDepth());
unit._x = random(320);
unit._y = random(190);
unit.fhp = 40;
unit.hp = 40;
unit.atk = 5;
unit.def = 0;
unit.atkb = 0;
unit.regen = 0
unit.spd = 2.5;
unit.attacking = false;
unit.alive = true;

unit.onEnterFrame = function() {
if (this._x < 5){this._x += this.spd;}
if (this._y < 10){this._y += this.spd;}
if (this._x > 315){this._x -= this.spd;}
if (this._y > 190){this._y -= this.spd;}
if (_root.marine.alive == false)
this.spd = 0;

_root.enemy = unit
if (this.hp < this.fhp){
this.regen += 1;
if (this.regen > 30){
this.hp++
this.regen = 0;
}
}
if (this.hp < 1) {this.meter.bar._width = 0}
this.meter.bar._width = (this.hp/this.fhp)*20

if (this.attacking && this.whole.attack._currentframe == 6){
_root.marine.hp -= this.atk - _root.marine.def + this.atkb;
_root.blood.gotoAndPlay(2);
}
myRadians = Math.atan2(_root.marine._y-this._y, _root.marine._x-this._x);
myDegrees = Math.round((myRadians*180/Math.PI));
if (this.alive){
this._x += Math.cos(myRadians) * this.spd;
this._y += Math.sin(myRadians) * this.spd;
}
if(circleHitTest(_root.marine,this) && this.alive&& _root.marine.alive) {
this.whole.gotoAndStop(2);
this.attacking = true;
this.spd = 0;
}else if(circleHitTest(_root.marine,this) && this.alive&& _root.marine.alive == false) {
this.whole.gotoAndStop(1);
this.spd= 2;
} else {
if (this.alive){
this.whole.gotoAndStop(1);
this.attacking = false;
this.spd = 2
this.whole._rotation = myDegrees+90;
}
}
if (this.whole.death._currentframe == 40){
this.removeMovieClip();
createZealot();
_root.marine.stat += 50;
}
if (this.hp < 0){
this.whole.gotoAndStop(3);
this.alive = false;
}
};
};
Thanks.
Or... even the most basic help would be the conversion of the cicleHittest

As1 To As2 Conversion
Hi these are files from Joshua Davis Praystation, I need help converting them from as1 to use with as2 published for player 9.

any help would be greatly appreciated.

Conversion
can any one please help me make this following html script work in flash:
<form action="/cgi-sys/guestbook.cgi" target=guestwindow>
<input type="hidden" name="user" value="sreeapqy">
<input type="hidden" name="action" value="addguest">
<input type="hidden" name="basehref" value="http://sreenadh.shyper.com">
<input type="hidden" name="template" value="default">
Name: <input type="text" name="name"><br>
Email: <input type="text" name="email"><br>
Url: <input type="text" name="url"><br>
Comments: <textarea name="comments"></textarea><br>
<input type="submit" value="Sign Guestbook">
</form>

AVI -> FLV Conversion
Hey gang, what software do you guys recommend for this kind of conversion?

Thanks!

-joe.

Mac To Pc Conversion
Ok, i've stumbled upon countless websites on how to convert pc .fla's to mac. However, i have the opposite problem. I need to know if there is a way to open mac .fla files on a pc. Everytime i try to, it says "unexpected file format. I haven't found any converters or anything that would help.

Swf>fla Conversion For Os X?
i have been experimenting with xcelcius which takes an excel spreadsheet and tweaks it, then exports it as a swf. i want to take that swf, put it in an existing fla and modify it further, resize it etc.

is there a way to convert it? i do have a pc emulator if there is a pc version and not a mac version converter.

thanks

Conversion From AS1 To AS3
This is my first post, let me know if I am asking too much. I am trying to recreate some flash stuff that I did with early flash AS1 and do it using AS3. I just got the CS3 suite and am now left with the task of leaning boat loads of new knowledge.

Here is the script that i'm trying to re-create in AS3, but i'm finding it's going to be more difficult than imagined.
Code:

// register root as environment
Object.environment = this;

// create camera object
this.cam = {x:0, y:0, z:500, dx:0, dy:0, dz:-500};

// set environmental constants
this.fl = 1000;

// create 'space' to which all words will be attached
this.createEmptyMovieClip("space",1);
// center 'space' on the stage
space._x=300;
space._y=169;

// a string of words
this.somewords = "Mac Photographer Inspiration Image Packaging Frame Obsession Light Pixel Emotional Media Time Cut";
// convert the string of words into an array of words
this.wordList = new Array();
this.wordList = this.somewords.split(" ");

// create one instance for each word in the list
for (n=0;n<this.wordList.length;n++) {
   // pick a word from the list
   var word = Object.environment.wordList[n];
   var x = random(600)-300;
   var y = random(337)-169;
   var z = random(Object.environment.fl*2)-Object.environment.fl;
   
   // create an instance of the SpaceWord object
   nombre = "word"+String(depth++);
   initialization = {txtword: word, x: x, y: y, z: z};
   space.attachMovie("spaceWord", nombre, depth, initialization);
}

this.onEnterFrame = function() {
   this.cam.dz+=.5;
   // move the camera to its destination
   this.cam.x+=(this.cam.dx-this.cam.x)/10;
   this.cam.y+=(this.cam.dy-this.cam.y)/10;
   this.cam.z+=(this.cam.dz-this.cam.z)/30;
}

stop();


There is also a bit of code inside a movieclip that controls each word, called "spaceWord", it is as follows:
Code:

#initclip
// constructor
function SpaceWord() {
   // set up button functionality
   this.btnSquare.onPress = function() {
      // push the camera towards the word by setting destination just a bit in front
      Object.environment.cam.dx = this._parent.x;
      Object.environment.cam.dy = this._parent.y;
      Object.environment.cam.dz = this._parent.z+Object.environment.fl*.9;
      // disable and hide button
      this.enabled = false;
      this._visible = false;
   };
   // set continual function to render word
   this.onEnterFrame = this.render;
}
// allow SpaceWord to inherit MovieClip properties
SpaceWord.prototype = new MovieClip();
// instance methods
SpaceWord.prototype.render = function() {
   var zActual = Object.environment.fl+this.z-Object.environment.cam.z;
   // has the object moved behind the camera?
   if (zActual>0) {
      // object is still visible
      // calculate scale
      var scale = Object.environment.fl/zActual;
      // set position using camera as an offset
      this._x = (this.x-Object.environment.cam.x)*scale;
      this._y = (this.y-Object.environment.cam.y)*scale;
      // set size
      this._xscale = scale*100;
      this._yscale = scale*100;
      // set fog
      this._alpha = 100 - 99 * zActual/Object.environment.fl*.5;
   } else {
      // object has moved behind camera
      // reposition further down the line
      this.z += Object.environment.fl*2;
      
      // enable button
      this.btnSquare.enabled = true;
      this.btnSquare._visible = true;
   }
};
SpaceWord.prototype.setWord = function(s) {
   this.txtWord = s;
};
SpaceWord.prototype.setPosition = function(x, y, z) {
   this.x = x;
   this.y = y;
   this.z = z;
};
// Connect the class with the linkage ID for this movie clip
Object.registerClass("spaceWord", SpaceWord);
#endinitclip

Conversion From AS2.0 To AS3.0
Code:


onClipEvent (enterFrame) {
      _root.myRim._x = (_root._xmouse);
      _root.myRim._y = (_root._ymouse);
   }


Sorry to ask this, but I was wondering how I would write this code that is attached to a movieclip object, in AS3. Thanks

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