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




Flash 6 To Flash 8 Migration Trouble



I was working on an old (mx), particularly cpu-heavy file I had lying around and trying to update it to as 2.0 and player 8 to see what the performance increase would be.

I basically just typed all the variables and didn't add any flash 8 specific code yet. But the movie doesn't work anymore.

What it does is: it takes the mouse input and moves three overlapping clips accordingly for a "Z-axis" effect. It worked fine in flash 6 /as1 but in 7 & 8 its just frozen. I didnt get any compile errors.

Can anyone spot the trouble?

code:


ActionScript Code:
function depthArrange(){    var oldXPos:Number = xPos;    var oldYPos:Number = yPos;    var xPos:Number = xPos - (xPos + _xmouse / 3) * 0.3;    var yPos:Number = yPos - (yPos + _ymouse / 3) * 0.3;    var xDelta:Number = xPos - oldXPos;    var yDelta:Number = yPos - oldYPos;     var bgXDest:Number = xPos * 1.3;    var bgYDest:Number = yPos * 1.3;        //background start    if (bgXDest <  (Stage.width - bg_mc._width))    {        bgXDest = Stage.width - bg_mc._width;    }    if (bgYDest <  (Stage.height- bg_mc._height))    {        bgYDest = Stage.height - bg_mc._height;    }           bg_mc._x = bg_mc._x - (bg_mc._x - bgXDest) * 0.2;    bg_mc._y = bg_mc._y - (bg_mc._y - bgYDest) * 0.2;    //background end        //contentground start    var contentXDest:Number = xPos * 0.5;    var contentYDest:Number = yPos * 0.5;        if (contentXDest < (Stage.width - content_mc._width))    {        contentXDest = Stage.width - content_mc._width;    }    if (contentYDest <  (Stage.height- content_mc._height))    {        contentYDest = Stage.height - content_mc._height;    }           content_mc._x = content_mc._x - (content_mc._x - contentXDest) * 0.2;    content_mc._y = content_mc._y - (content_mc._y - contentYDest) * 0.2;    //contentground end        //forground start    var fgXDest:Number = xPos * 2.3;    var fgYDest:Number = yPos * 2.3;        if (fgXDest < (Stage.width - fg_mc._width))    {        fgXDest = Stage.width - fg_mc._width;    }    if (fgYDest <  (Stage.height- fg_mc._height))    {        fgYDest = Stage.height - fg_mc._height;    }           fg_mc._x = fg_mc._x - (fg_mc._x - fgXDest) * 0.2;    fg_mc._y = fg_mc._y - (fg_mc._y - fgYDest) * 0.2;    //foreground end}  var lookInterval:Number = setInterVal(depthArrange, 20);



Ultrashock Forums > Flash > Flash Professional
Posted on: 2005-10-06


View Complete Forum Thread with Replies

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

Migration Trouble From As2 To As3
Hi guys !
I'm having big problems trying to migrate this code from AS2 to AS3.
i have understood the way to change the createEmptyMovieClip but i still don't know how to translate the mc[clip_name].


ActionScript Code:
private function makeclip(mc: MovieClip, clip_name : String, bm_width : Number, bm_height : Number)
        {
            mc.createEmptyMovieClip(clip_name, mc.getNextHighestDepth());
            ('field_container_mc', mc[clip_name].getNextHighestDepth());
            mc[clip_name].field_container_mc.createTextField('field_mc', mc[clip_name].field_container_mc.getNextHighestDepth(), 0, 0, bm_width, bm_height);
            mc[clip_name].field_container_mc.field_mc.autoSize = 'left';
            mc[clip_name].field_container_mc.field_mc.embedFonts = true;
            mc[clip_name]._x = - Math.round(bm_width / 2);
            mc[clip_name]._y = - Math.round(bm_height / 2);
        }

thanks to anybody who can help

- Actarus -

Flash 6 To 7 Migration - What Do You Use
Well Flash 8 is almost here, and I wanted to get people's input on whether they publish flash player 7 movies, flash player 6, and flash 5 movies still. A client of mine was asking me the other day, what's the diff between versions, and I got into all of the features per version etc, but then we started talking about distribution and usability, and I started explaining to him (i was preferencing him to go with flash player 7 technology) tho I aswell explained to him that lower versions like flash 5 & flash 6, have been on pplz's machines for a while now, so in the end he asked me, what would I use ? I told him I prefer flash player 6, since most people have that on their machines, and that flash player 7 has only been out for a year, so I want to get your expert opinions on this !

Flash 6 To 7 Migration - What Do You Use
Well Flash 8 is almost here, and I wanted to get people's input on whether they publish flash player 7 movies, flash player 6, and flash 5 movies still. A client of mine was asking me the other day, what's the diff between versions, and I got into all of the features per version etc, but then we started talking about distribution and usability, and I started explaining to him (i was preferencing him to go with flash player 7 technology) tho I aswell explained to him that lower versions like flash 5 & flash 6, have been on pplz's machines for a while now, so in the end he asked me, what would I use ? I told him I prefer flash player 6, since most people have that on their machines, and that flash player 7 has only been out for a year, so I want to get your expert opinions on this !

Flash CS3 Migration: Still Use AS2 Publish Settings Bad?
[similar post in Flash CS3 forum but I thought the AS3 community might have some input]

Hey all,
My company is switching to Flash CS3. We do pretty basic interactivity...nothing ever requiring external classes. The designers I work with occasionally have to help me out with flash when we get too busy, but they aren't coders and therefore they don't want to use AS3 publish settings so that they can still have code on buttons, simple on(event) code, etc.

I want to argue that they should learn basic AS3 for the sake of posterity, but I can't come up with any really good reasons since the stuff we do is pretty basic.

Is it a bad idea to stick with AS2 publish settings?
Any input is greatly appreciated.

General Questions On Swish To Flash Migration
Due to many considerations, not the least of which is that I've come to realize that Swish is too tedious to use, and its representatives are sometimes contemptuous towards its customers, I'm considering alternatives. These might likely be very dumb questions. I'm sort of shooting in the dark.

1. Is Flash both a viewer and a development tool? In other words, if I have Flash, do I have the tool to create Flash presentations, or must I buy a tool like Swish?

2. Is Flash or the Flash tool developer friendly? That is, does it give the developer a way to set, save, and recall a wide variety of default settings?

3. Is the company customer-oriented, inviting input from customers, or is it proprietary and arrogant?

4. Was it a mistake to have tried Swish first? Will there now be a lot of stuff to "unlearn", causing a greater learning curve?

5. Finally, where can I get more general information, such as product specifications and features that is more than just fluff or propoganda?

Migration From Flash Mx To Flash 8
Hi,
i am migrationg my application from flash mx to flash 8
when compiling i got like 90 warnings, the following are some examples:

**Warning** The linkage identifier 'Tree' was already assigned to the symbol 'Tree', and cannot be assigned to the symbol 'PDF/Tree', since linkage identifiers must be unique.

**Warning** The linkage identifier 'RadioButton' was already assigned to the symbol 'export/RadioButton', and cannot be assigned to the symbol 'PDF/RadioButton', since linkage identifiers must be unique.

**Warning** The linkage identifier 'btnCancel' was already assigned to the symbol 'PDF/pdfCancel', and cannot be assigned to the symbol 'PDF/pdfCancel', since linkage identifiers must be unique.

any idea on how to fix those?
thanks.

Migration To AS3
Howdy,

We need more of you to migrate over to AS3. 113 People viewing the AS2 forum... 13 Viewing AS3. AS3 has so many benefits that it worth the plunge. Bite the bullet and move over the AS3 forum!

See you guys there!

AS2 To AS3 Migration Help
Hello I have this bit of code in AS2 that I must translate to AS3 to use it in Adobe Flex:

var depth:Number = this.getNextHighestDepth();
var node:GraphNode = GraphNode(this.attachMovie("GraphNode", "node" + depth.toString(), depth, {_x:depth * 10, _y:depth * 10}));

I am at a total loss as to how to translate this code to AS3 - can anyone help me please? I know both the "getNextHighestDepth()" and "attachMovie()" are gone in AS3 so I don't know how to make this code work in AS3. Thank you!

AS2 To AS3 Migration
For those of you who are trying to migrate over to AS3... here's a good reference.

http://livedocs.adobe.com/flex/201/langref/migration.html

EDIT:

Okay... since the link above is for Flex, here are two links that are for Flash AS2 to AS3 migration

http://www.adobe.com/devnet/actionscript/#migrating_as3

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/migration.html






























Edited: 11/05/2007 at 12:19:46 PM by "B"

Migration To AS3
I have been using Flash and Actionscript for some years now and I have found it very difficult to take on board at times. I keep promising myself that I will get to grips with Actionscript so that the applications I develop look as good as the ones I see in Web Designer magazines. However, after a really big effort to complete my prefered Actionscript2 book (Flash MX 2004-Derek Franklin/ Jobe Makar-training from the source) I find myself questioning my efforts and start to wonder if AS3 is going to be easier to get to grips with. I have read reports on AS3 being ten times faster in terms of its processing power, but what percentage of the web industry has migrated to AS3? Do I forget AS2 and focus my efforts on AS3 in order to improve my development skills and gain a better position in the job market or what?

AS2 - 3 Migration
Hi, I am new to Flash CS3 so sorry if this is an easy question, I found a nice easy example of making a digital clock online, I followed the example and everything worked using AS2 but when I tried to do the same in AS3 the _root.onEnterFrame = function() { at the top of my code did not work. I read in the help files that this has been changed so I have tried to change this to work but I have not been successful. Could anyone tell me what the top line of code should be to get this working as I am unable to get it right.

Thanks
Mark







Attach Code

_root.onEnterFrame = function() {

var myDate:Date = new Date();
var myHours = myDate.getHours();
var myMinutes = myDate.getMinutes();
var mySeconds = myDate.getSeconds();

if (myHours < 10) {
myHours = "0" + myHours;
}

if (myMinutes < 10) {
myMinutes = "0" + myMinutes;
}

if (mySeconds < 10) {
mySeconds = "0" + mySeconds;
}

time_txt.text = myHours + ":" + myMinutes + ":" + mySeconds;

}

AS2 To AS3 Migration
Hi ,

I am in a trouble with dynamic naming of movie clips.
In AS2 to attach a movie clip from the library to the stage we use


this.attachMovie("linkageName", "instance1", this.getNextHighestDepth());
Here we are able to name the attched movie dynamicaly(instance1,2,3....)
But in AS3
this is bit changed.
where mcMenu is in the librery.
var myMC:MovieClip = new mcMenu;
this.addChild(myMC);

In this case how we name the attached movieclip dynamically.
Please help me.

Migration To AS2
Hi everybody, I am going crazy trying to conver this little script into AS2. I have been using it at Flash 5 without any problem by I just upgraded to Flash 8 and still want to use it. Any help would be appreciated. Thank you very much.

///////////////////////////////////////////////////////////////////////////////////

onClipEvent (load){
function speed(num)
{
speedX = -(_root._xmouse - hx) / num;
return(speedX);
}
function trans(){
p = p + speed(60);
range = (p + 308) * 3.141593 / 180;
re1 = Math.sin(range) * r;
re2 = Math.cos(range) * a;
}
function property(){
trans();
_x = hx + re1;
_alpha = re2 + 70;
_yscale = re2 + 70;
_xscale = re2 + 70;
this.swapDepths(_alpha);
}
hx = 650;
hy = 200;
r = 100;
a = 30;
}
onClipEvent (enterFrame)
{
property();
}

////////////////////////////////////////////////////////////////////////////////

Really Need Some Help With AS2>>AS3 Migration
Not sure why it took me so long to remember I was a member here and ask for help. You guys have always been great about giving good advice, and I've been beating my head against a wall with this for a week.

Summary of the problem. A few years ago, kirupa members UNFLUX and lostinbeta designed a Flash website for my company. The original design was published for Flash 6 and AS2. I've made a lot of modifications to the site since then (I finally actually learned Flash), and have so far been able to do what I need to, but now I'm stuck.

I recently figured out how to use the Google earth API and my company CEO wants to incorporate it into the website. Took me a bit to figure that out, but eventually realized I needed AS3 to get it to work as desired. So I upgraded to CS3, and got that working just fine. However, when I tried to incorporate it in the company's Map and Directions page it broke the majority of the AS2 code, primarily a scroll, that I absolutely have to have work.

AS2 I can handle, but AS3 is spanking brand new to me and I had no idea how much things had changed. I plugged along and made some progress, but I'm not getting much help at actionscript.org where I've really been detailing what I'm doing. I'm hoping that someone here can give me some help to complete what I've started.

Rather than copying multiple large posts that I've made, if you would, please read the entire problem in my post at actionscript.org It pretty much explains everything and what I've done to date.
http://www.actionscript.org/forums/s....php3?t=179083

I included the FLA's in a couple of those posts.
My progress yesterday led me to believe that my best solution would be to create a package and handle things from that angle. But prior to yesterday I'd never even seen an AS3 package.

I'm a quick learner and can follow directions, and pretty logical about troubleshooting on my own. But being a noob at AS3 really isn't helping me much and I need to get this done.

I've been trying to track down lostinbeta who wrote the original action script, but I've lost touch with him. If anyone knows how to contact him could you let him know I'm looking for him? I left a message with UNFLUX, but haven't seen him online all week.

Thanks for any help you can give. If you have any questions let me know. The website this page will go in is www.alaron-nuclear.com

mark

Migration From AS 1.0 To AS 2.0
Hi,

I was working on a project with actionscript 1.0. It's almost finished and close to the deadline suddenly client wanted to AS 1.0 to AS 2.0 migration for the same project Rewriting the whole things is not easy. What is the most easiest way to convert my script from AS 1.0 to AS 2.0. Any help or suggestions will be really helpful.

thanks in advance

Trouble With My Flash
Another webmaster built a flash app for me. It is very simple but when you click on a slider it doesn't do what it is supposed to. It will go from the first position and slide to the middle and become unusable. In flash mx i will fix it and test it and it will work however when I put it into my website it breatks again. The example is here http://www.sundanceresort.com/newsite/skiing.htm The pass calulator on the right is the app. Click season pass and then move the Junior pass slider. It stops in the middle. I can't seem to get it to work. Any help would be appreciated.

The fla's are on the dev portion of our site.
http://www.sundanceresort.com/newsite/help/rateCalc.fla
http://www.sundanceresort.com/newsit...onPassCalc.fla
http://www.sundanceresort.com/newsite/help/snowing.fla

Flash MX/Mac/IE5 Trouble
Ive been getting reports from people using Mac OS 9 and IE 5 saying they cannot view sites ive done in flash mx.
Is there any way to remedy this problem?
Thanks.

Php , Asp -> Flash Trouble......
Hi guys , I´m just trying to do a very simple form with name , surname , coments and send following the tutorial from http://www.flashkit.com/tutorials/Dy...-658/more8.php but I´m having some problems...... Basically , when I press send it shows the sending message in flash what means the flash code is fine i think but the browser doesnt load nothing and the email doesnt sends.... I´ve tried with asp and php , online and offline and still the same
This is my flash code for the send button

on (release) {
if (!FEmail.length || FEmail.indexOf("@") == -1 || FEmail.indexOf(".") == -1) {
EmailStatus = "Porfavor, introduce una direccion de E-mail valida.";
}
else if (!FName.length) {
EmailStatus = "Porfavor, introduce un nombre.";
}
else if (!FContent.length) {
EmailStatus = "Porfavor, introduce un mensaje.";
}
else {
loadVariablesNum ("ASPMail.asp", "0", "Post");
EmailStatus = "Enviando informacion via SWAT Mailer 1.0...";
}
}

The ASPMail.asp is in the same folder as .swf

This is my asp code:

<%
FName = Request.form("Nombre")
SName = Request.form("Apellidos")
FEmail = Request.form("Email")
FContent = Request.form("Mensaje")

strName = "ruben henares"
strEmail = "ruben@myserver.com"

strSubject = "Tutorial Request Example Email"
strBody = Fcontent

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.RemoteHost = "smtp.my.server.com"
Mailer.FromName = FirstName
Mailer.FromAddress = Email
Mailer.AddRecipient strName, strEmail
Mailer.Subject = (strSubject)
Mailer.BodyText = strBody

if Mailer.SendMail then
Response.Write "_root.Mail.EmailStatus=Complete - Tu mensaje ha sido enviado."
else
Response.Write "_root.Mail.EmailStatus=Failure - Tu mensaje no ha podido ser enviado - errors"
Response.Write Mailer.Response
end if
%>


I´m working with flash mx and dreamweaver mx , any help will be apreciated.
Thanks guys!

Flash Trouble, Help Please
Hi, I'm new here, glad to be apart of the forums.

I have a problem in flash. I had a flash intro that works well until It comes to a menu I set up. In this menu I have a button that I wanted to link to another scene I have. This is the actionscript I am currently using:

on (release) {
nextScene();
}

It was working but with a error message. It said that on (release) can only be used with button instances, which it was. Trying to fix the problem, made me mess up the scene and now it wont link to the next scene anymore.

Can someone please help me? Thanks guys.

Having Trouble With Flash
Ive been having trouble installing flash. i have it working properly on one account but thats not my main admin account. ive tried the uninstaller method and when i go to reinstall it instead of the compeletion movie i get nothin just
"


" absolutly nothin.

Flash Trouble
Here is what I need to do:
I am trying to program next and a back buttons to navigate through a slide show. I have done this many times in older Flash versions but in the new cs3 Flash I am unable to do what I usually did. Can someone please give me the proper actions to apply to a back button and a next button? I know, it's probably simple. :) Thanks.
Also, my old preloader doesn't work so if I could get help on the programming for that it would be a bonus!
Here is what I got:
WARNING: Text field variable names are not supported in ActionScript 3.0. The variable 'percentageOutput' used for an unnamed text field will not be exported.
WARNING: Actions on button or MovieClip instances are not supported in ActionScript 3.0. All scripts on object instances will be ignored.

Flash Trouble
ok im trying to put a rectangle border around my object and get it to have a blinking effect on the border, how do i do this?

Flash Php Trouble
I have created an application that i supposted t o create a directory of the username the user enters it is then supposted to create a text file in the folder with the password in it. The problem im having is that the directory wont be created, if i change the location of the text file the text file will be created but the folder still iwll note. Could some one take a look at my codes and tell me whats wrong?

Thanks for any help!








Attach Code

//PHP:

<?php
//Capture data from $_POST array
$user = $_POST['user'];
$pass = $_POST['pass'];
// make directory
mkdir("http://comp.local/~server/users/".$title, 0755);
// what to save
$toSave = "password=".$pass;
//Open a file in write mode
$fp = fopen("http://comp.local/~server/users/".$title"/username.txt", "w");
if(fwrite($fp, $toSave)) echo "writing=Ok";
else echo "writing=Error";
fclose($fp);
?>

//Actionscript:
submit.onPress = function(){
if(Title.text!="" && Comments.text !="" && Image.text!=""){
myData.user = user.text
myData.pass = pass.text
myData.sendAndLoad("save.php", myData, "POST") //php
}
}
myData = new LoadVars()
myData.onLoad = function(){
if(this.writing=="Ok") {
gotoAndStop(2)
status.text = "Submited data was saved"
}
else status.text = "Error in saving submitted data"
}
stop()

Trouble With Php And Flash
I am trying to get php to send data to flash, but it's acting a bit strange.

I have flash send php data, make php check that data against a database, and then send back to flash if that data was found or not. I have all of it working except sending the data back to flash.

my php script will do this to pass the varaiable like this:


Code:
echo "st4tus=failed";
then in flash, it saves it to the variable 1st4tus instead of st4tus. why is this?

Is This Possible With Flash (without Much Trouble)?
Hello,

I want to create an interactive bar graph where the user can drag the bar to the desired value. Can this be done without too much trouble using Flash? Thanks for the help.

IF Statement - AS2 Migration
Simple problem... hopefully


Code:
var newVar1 = 1
var newVar2 = 4

if((newVar==1)and(newVar2==4)){
trace("hello world")
}


the above works in AS2 but not AS3... what am I missing?

Migration Tools?
Hi,

I'm looking to upgrade from flash 8 to flash cs3 and I was wondering if there are any migration tools available or guides to make my life easier as far as updating and converting old flash applications to cs3?

I have a few different ones, some are MX, and some are flash 8 that I want to convert. I'm not very experienced with flash just yet so any help I can get with this would be very benefitial.

Just curious before I upgrade to cs3

thanks

Dynamic MC - Migration To AS 3
Hi,

I've programmed an animated creature for some years ago in AS 2.
Now I want to program this in AS 3. Some of the code look like this:



Code:
for(i=0; i < body_array.length; i++){
if(i == 0){
attachMovie("head", "part"+i , n+1-i)
}else{
attachMovie("tail", "part"+i , n+1-i)
}
part[i] = this["part"+i];
part[i]._x = startX + (i*space);
part[i]._y = startY;
part[i]._xscale = body_array[i];
part[i]._yscale = body_array[i];

}


I know we can write like:
var head:Head = new Head();
addChild("head");

But how can we put it in different levels? And how to use like this["part"+i];?
I haven't got the addChildAt("tail", i); workin...

Thankful for some advise about this.

/S-fish

AS2->AS3 Migration Question
What is the ActionScript 3 equivalent of "this[i]" in AS2?
As in:

ActionScript Code:
for(i = 0; i < this.items.length; i++) {
    this.createEmptyMovieClip(String(i), i+2).attachMovie(itemArray[i].id, '_mc', 1);
    this[i]._mc._y = -56;
    this[i]._x = this[i].x = 26 + i * 90;
        }


Thanks.

AS2 -> AS3 Migration: UnloadMovie() -> ?
I inherited some AS2 code that I am trying to convert into AS3. Is it possible to do the red code in AS3? I don't want to destroy and rebuild the wheel if I don't have to do it -- the other 95% of the code translated perfectly into AS3. Any help would be greatly appreciated.

function HomeButton(event:MouseEvent):void
{
/* I do not know how to translate these two lines into AS3 */
_root.subtopic.unloadMovie();
_root.title.unloadMovie();


/* This AS3 code does what I want it to do. */
var lHome:Loader = new Loader();
var urlrHome:URLRequest = new URLRequest("home_1-1.swf")
addChild(lHome);
lHome.load(urlrHome);// load "home_1-1.swf"

}

Migration Issue
Hello can any one help me Migrate this as2 to as3 please






accell = .3;
decay = .98;
maxTurnRate = 0.01;

truck.onEnterFrame = function()
{

if (key.isDown(Key.UP))
{
this.speed+=accell;
}
else if (key.isDown(Key.DOWN))
{
this.speed-=accell;
}

if (key.isDown(Key.RIGHT))
{
this.turnRate += maxTurnRate;
}
else if (key.isDown(Key.LEFT))
{
this.turnRate -= maxTurnRate;
}

this.leftWheel._rotation = this.turnRate * 300;
this.rightWheel._rotation = this.turnRate * 300;

this.speed *= decay;
if (Math.abs(this.speed) < 0.1) this.speed = 0;

this.ang+=(this.turnRate * this.speed * .1);

this.turnRate *= 0.86;

this.dx = Math.cos(this.ang) * this.speed;
this.dy = Math.sin(this.ang) * this.speed;

this._x += this.dx;
this._y += this.dy;
this._rotation = this.ang / (Math.PI / 180);

shadow._x = this._x + 7;
shadow._y = this._y + 7;
shadow._rotation = this._rotation;

}

AS2 To AS3 Migration: AttachSound()
This had me stuck, and a forum Search didn't really answer the question, so I figured I'd post the solution here.

In AS2 someSoundObject.attachSound("soundInTheLibrary") is used to introduce an internal sound file... one in the library of your .fla... onto the Stage at compile time. The attachSound() does not exist in AS3.

So you've got an AS3 .fla open, with the sound trainwreck.mp3 in the Library.Right-click the sound file
Select Linkage from the dropdown
In the Linkage Properties window that opens, check Export for ActionScript and Export in First Frame
You'll see the sound-file name is listed as the Class. Delete ".mp3" and capitalize the first letter. Also close any word spaces.

To attach the sound to an object do like so...

Code:
var noise:Sound = new Trainwreck()
Hope this is of some help.

Help In Code Migration
Dear All,

this is not working in AS 2.0 flash player 8.. plz help me wht to do ?

Migration Issue
Hey all,

So I have a really crazy problem. I was working on a file last night while at home, and I had it working just fine. But when I got in to work this morning, it was no longer working, and I have NO idea why. The only difference is that I have CS4 Pro at home, and CS3 Pro at work.

I've at least isolated the class that's causing the problem, but here's the real kicker... The compiler isn't giving me an error at all. But there's an error somewhere. There has to be. Otherwise, the interface wouldn't do the flicker thing on me (there are 3 frames in the main timeline. The opening frame, a selection frame, and the actual interface frame. If I comment out the references to the "problematic" class, the interface works just fine (sans that class, of course). leave the instance call in, and the references, and the whole thing breaks (with no apparent errors!).

So I'm assuming that it's a migration issue (It's all AS3, but as I said, one computer has CS4, and the other has CS3).

I'm posting the code here, but I'm also going to attach the class file if that might be easier for you to look at. It's sort of long to look at online maybe...

Anyways, if any of you could take a look at it and see if there's a method or something I might have used that's in CS4, but not CS3, it would be much appreciated.


ActionScript Code:
package coms.tools.extensions {
    import flash.display.Shape;
    import flash.display.Graphics;
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    import flash.events.Event;
    import coms.utils.hostHolder;
   
   
    public class colorBoxes extends Sprite {
        //creation vars
        private var colorBoxHolder:Sprite = new Sprite();
        private var _width:Number = 20;
        private var _height:Number = 20;
       
        private var changeColorBoxes:Array = new Array();
       
        //attachment vars
        private var attachTarget:Sprite;
        private var gotoFrame:Number;
        private var _frame:Number;
        private var _colorsTarget:*;
        private var colors:Array;
       
        public function colorBoxes(boundingBox:Sprite,colorsTarget:*) {
            attachTarget = boundingBox;
            _colorsTarget = colorsTarget.getChildAt(0);
            _frame = _colorsTarget.frame;
            init();
        }
        private function init():void {
            this.x = 1;
            this.y = attachTarget.height-26.1;//attachTarget.parent.height-(26.1*attachTarget.parent.scaleX);
            addChild(colorBoxHolder);
           
            this.addEventListener(Event.CHANGE,colorsImported);
        }
        private function colorsImported(e:Event):void {
            setBoxes();
            this.removeEventListener(Event.CHANGE,colorsImported);
        }
        private function setBoxes():void {
            var numBoxes:Number = colors.length-2;
           
            for (var i:uint=0;i<=numBoxes;i++) {
                createBox(i);
            }
           
        }
        private function createBox(num:uint):void {
            var box:Sprite = new Sprite();
            var placement:Object = (num == 0)?{x:-_width/2,y:-_width/2} : (Math.floor(num/2) == num/2)?{x:-_width/2,y:Math.ceil(num/2)*-23+(-_width/2)} : {x:Math.ceil(num/2)*24+(-_width/2),y:-_width/2};
            box.x = placement.x;
            box.y = placement.y;
            var boxColor:uint = (num >= _frame-1)? num+1 : num;
            var boxObj:Object = {instance:box,number:boxColor};
            placement = null;
            changeColorBoxes[num] = boxObj;
            makeBox(box,false,boxColor);
            colorBoxHolder.addChild(box);
            box.addEventListener(MouseEvent.MOUSE_OVER,rollBox);
            box.addEventListener(MouseEvent.MOUSE_OUT,rollOffBox);
            box.addEventListener(MouseEvent.MOUSE_DOWN,colorMyTarget);
        }
        private function makeBox(box:Sprite,outline:Boolean,boxColor:uint):void {
            box.graphics.clear();
            box.graphics.lineStyle(0,0x000000,0);
            box.graphics.beginFill(_colors[boxColor],1);
            box.graphics.drawRoundRect(0,0,_width,_height,4);
            box.graphics.endFill();
            if (outline) {
                box.graphics.lineStyle(2,0x000000,1);
                box.graphics.drawRoundRect(-2,-2,_width+4,_height+4,4);
            }
        }
        private function rollBox(e:MouseEvent) {
            var box:* = e.target;
            var boxColor:uint;
            for (var i:uint=0;i<changeColorBoxes.length;i++) {
                var tempObj:Object = changeColorBoxes[i];
                var tempNum:uint = (tempObj.instance === box)? boxColor = tempObj.number : null;
            }
            trace(boxColor);
            makeBox(box,true,boxColor);
        }
        private function rollOffBox(e:MouseEvent) {
            var box:* = e.target;
            var boxColor:uint;
            for (var i:uint=0;i<changeColorBoxes.length;i++) {
                var tempObj:Object = changeColorBoxes[i];
                var tempNum:uint = (tempObj.instance === box)? boxColor = tempObj.number : null;
            }
            makeBox(box,false,boxColor);
        }
        private function colorMyTarget(e:MouseEvent):void {
            var box:* = e.target;
            var boxColor:uint;
            for (var i:uint=0;i<changeColorBoxes.length;i++) {
                var tempObj:Object = changeColorBoxes[i];
                var tempNum:uint = (tempObj.instance === box)? boxColor = tempObj.number : null;
            }
           
            _colorsTarget.frame = _frame = boxColor+1;
            _colorsTarget.setColor();
            for (i=0;i<changeColorBoxes.length;i++) {
                var deadObj:Object = changeColorBoxes[i];
                var deadBox:Sprite = deadObj.instance;
                colorBoxHolder.removeChild(deadBox);
               
            }
            changeColorBoxes.splice(0,changeColorBoxes.length);
            setBoxes();
        }
        public function set _colors(obj:Array):void {
            colors = obj;
            dispatchEvent(new Event(Event.CHANGE));
        }
        public function get _colors():Array {
            return colors;
        }
       
    }
}

If you guys have any questions, feel free to ask me. This is pretty vital, as it really does completely break the system, and I have no idea why...

Product Migration
I've just acquired a new desk top computer. I installed Studio 8 on my notebook last year. How do I move it to the desk top? Do I need to uninstall it from my notebook? I occasionally use the notebook for design work and for client location explanation and demonstration so it would be nice to have it on both.

Migration From AS2 To AS3 Problem
Hey

I encountered a severe problem when trying to migrate from flash 8 to flash cs3:
After working on a FLA from flash 8 a for a while in Flash CS3 and converting the code to AS3, after I published what I worked on, I saw the the ActionScript code doesn't get activated on the player. When trying to debug I got the following message box:

You cannot debug this SWF because it does not contain ActionScript

Obviously my FLA contains A LOT of ActionScript code...

From this point on, any new FLA - AS3 files that I create show the same problem. The code simply doesn't get compiled to the SWF and trying to debug it results in the message above.

Thanks, Danny

SQL Migration To Server
1. I must completely thank all of you on this forum, especially The FeldKircher, (and David Powers' book - PHP5 for Flash) for helping getting this project to work!

2.After a long and hard road, I finally completed a flash 8 (AS 2.0) that uses the netdrims component/Netdrims php file, to load one mySQL database, use it, and then save new information to 4 different tables in that database.

3. This was proven to work on my local, offline PC using mySQL 5.x, Apache, php 5.x, and myPHPAdmin.

4. As this is my first time, I want to upload the mySQL database, html, and swf files to my server.

(i.e. migration of completed flash,php,SQL project from localhost to server)

5.The host of my Linux server runs appropriate versions of Apache, mySQL, php.

6. What considerations are important?
Do I need to change the component path from localhost to something else?
How do I set up the root password to the mySQL database on the server, etc.

In short, what parameters that I set up in the flash component/mySQL, Flash, that I got to work on my PC as localhost do I need to change to get the same project to work on my web server?

Thanks.





























Edited: 01/22/2008 at 07:18:18 AM by MYSCREENNAMEISUNAVAILABLE

Script Migration
I am a very simple soul - my needs are simple - I try to keep my life simple - all I need are very simple things
Lately life has become very complicated: for instance;
Need 1: to stop the maintimeline I use stop(); according to adobe stop(); now equals flash.display.MovieClip.stop();
only that doesnt work.
So how do you stop the maintimeline?

Actionscript 3 Migration
Hi, i am migration from AS2 to AS3 , in this process i have a due.
for example:
In AS2: If i have a MC at level0 called "ball"( level0.ball ), a button_mc inside a panel_mc and this is at level0 (level0.panel.button), and i want to move the ball clicking the botton, after an "Onpress" i can write:
-->level0.ball._x++ or _parent._parent.ball._x++
note:panel_mc and button_mc are moviclips.
My due is, what have i to write to get the button changes the x possition in AS3? assuming i have 3 classes (class "example1" associate to main , class "panel" and class "button1" ).

Thanks and sorry if my english is not good.

Migration Help With CreateEmptyMovieClip
Hi,
I'm having some big problems trying to migrate this part of code from AS2 to AS3. I'm newbie, and tried to google examples, but i still can't get it. If someone could really help me, please.

quote: mc.createEmptyMovieClip(clip_name, mc.getNextHighestDepth());
('field_container_mc', mc[clip_name].getNextHighestDepth());
mc[clip_name].field_container_mc.createTextField('field_mc', mc[clip_name].field_container_mc.getNextHighestDepth(), 0, 0, bm_width, bm_height);
mc[clip_name].field_container_mc.field_mc.autoSize = 'left';
Thanks, Maurice

Migration From MX To MX 2004
Hi guys i am a novice designer(hobby)

I had completed a site with Flash MX 3 months ago.
I installed mx 2004 1 week ago and i see that my files are not correctly displayed by mx 2004. I mean ray of light doesn't work anymore... The loadvars is all messed up...
Is there any way to migrate safely my files?


thanks

AS2 - AS3 Component Migration
Has anyone tried to migrate V2 component code to AS3? What's all involved with this? Is the process for creating custom components in AS3 dramitcally different? I'm trying to gauge how much work this will be... I've got quite a few components written in AS2 (V2 architecture), and guess I'll have to migrate.

Migration Problem
Im having a problem migrating some actionscript 2.0/Flash 8 code to actionscript 3.0/Flash 9. Here is the flash 8 code;

id = _parent.id;

All this code is doing is setting the variable id equal to _parent.id. _parent.id is defined in an .asp page that contains the .swf.

So really what I need to do is load the variable id from the hosting page... I cannot do it with a URLRequest/URLVariables/URLLoader because the url is a reset password page and it changes per user. I have also tried using id = stage.id or root.id or parent.id none of those work either.

Migration From MX To MX 2004
Hi guys i am a novice designer(hobby)

I had completed a site with Flash MX 3 months ago.
I installed mx 2004 1 week ago and i see that my files are not correctly displayed by mx 2004. I mean ray of light doesn't work anymore... The loadvars is all messed up...
Is there any way to migrate safely my files?


thanks

AS2 To AS3 Migration Problems
import flash.external.ExternalInterface;
var cookieValue: = ExternalInterface.call("myGetCookie", "yumyum");
if (cookieValue==1) {this.gotoandplay(15)}


This worked perfectly in AS2. But these people have compeletly changed everything with AS3. I get all kinds of errors in AS3. Any help on how to code this right in AS3?

ReferenceError: Error #1056: Cannot create property ::cookieValue on global.
at Timeline0_e48252b3c782d46a9f429a26c25bf69/::frame5()

The ExternalInterfaceCall is calling a javascript which gets a cookie called yumyum.


Please help...

Flash On A Web Site Trouble
how do you put a flash file or file that is readable on a web page i am useing flash 5 and ie 5

thanks

Flash Mailform Trouble
Hi,

I have a simple form within my flash movie (which is not working) I have this code on my button:

on (release) {
subject = "Contact from Mars";
recipient = "me@mysite.com";
loadVariablesNum ("http://www.mysite.com/cgi-bin/simpsend.pl", 0, "GET");
}

I dont know cgi or perl and I'm just using my hosts supplied formmail script, can this be done, do I need to make my own script?

If it is a case of modifying my own script does anyone know of any good resources?

Thanks muchos yet again!

Trouble With Flash Detection Kit
I have downloaded the deployment kit from Macromedia and followed the instructions by placing the dispatcher.js, dispatcher.vbs and detectflash.swf on my server. I have also set up the necassary parameters for users to be directed to an alterante page (noflash) if they don't have Flash 6. In testing it when I completely removethe FLash player I am directed to the noflash page but when I try it with the flash 5 player I get right through to the flash 6 content whish obviously is not viewable. Any help would be greatlt appreciated

TROUBLE WITH Ns 7.0 AND Flash.SetVariable
Hi!

I am using NS 7.0 with Flash 6.0 r47 player.
When I am want to change some flash value from select,
in javascript console I have an error ".SetVariable is not a function".

I have this function and object:

function ChangeLocation(prostorija) {
//document.tlocrt.SetVariable("trenutni", prostorija);
mObject("tlocrt").SetVariable("trenutni",prostorij a);
}

<script language="JavaScript">
out='<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"';
out+=' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"';
out+=' WIDTH="200" HEIGHT="240" name="tlocrt">';
out+='<PARAM NAME=swliveconnect VALUE="true">';
out+='<PARAM NAME=movie VALUE="../include/flash/tlocrt.swf#trenutni=<?=$play_vr_no?>">';
out+='<PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF>';
out+='<EMBED swliveconnect="true" ID="tlocrt" name="tlocrt" src="../include/flash/tlocrt.swf#trenutni=<?=$play_vr_no?>" quality="high" bgcolor="#FFFFFF"';
out+=' WIDTH="200" HEIGHT="240" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"';
out+='></EMBED></OBJECT>';
if (canIFlash(5)){
document.write(out);
} else {
document.write("<img src='include/images/tlocrt.gif' border='0' usemap='#tlocrt'>");
}
</script>

Any ideas please...

Cash

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