Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Error Code 1151

New Here ,
Jan 15, 2017 Jan 15, 2017

I built my website with Flash in 2010 (Action Script 2.0) and am trying to add material, now using Animate CC 2017 (which requires it to convert to AS 3.0). 

When I open the old .fla file and then run thru Control/Test Movie it comes up with the following error code message:

"1151 A conflict exists with the definition MyHoriTween in namespace internal".

In the Actions pane, the offending code reads:

____________________________________________

import mx.transitions.Tween;

import mx.transitions.easing.*;

var myHoriTween:Tween = new Tween (Logo_ON_mc,"_x",Strong.easeOut,-450,-74,2,true)

!

___________________________________________________________

And there are 3 other 1151 type errors all relating to Tweens. 

Can anyone help?

2.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 16, 2017 Jan 16, 2017

that should be:

import fl.transitions.Tween;

import fl.transitions.easing.*;

(p.s when using the adobe forums, please mark helpful/correct responses, if there are any.)

Translate
Community Expert ,
Jan 15, 2017 Jan 15, 2017

you shouldn't re-declare the same variable:

var myHoriTween:Tween

should only appear once on any one timeline/class.  it can be reused but that's not necessarily wise. using different names is more prudent:

var tween1:Tween = whatever;

var tween2:Tween = whatever else;

etc.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 16, 2017 Jan 16, 2017

Thanks kglad.

I think I fixed that (at least the errors went away--though it still cycles through without stopping) but now I am getting an error code regarding the Sound layer:

1046 Type was not found or was not a compile-time constant: Void

And this was the code line it was referencing

var game_sound:Sound = new Sound();

game_sound.onLoad = function(success:Boolean):Void {

if (success) {

trace("Sound Loaded");

game_sound.start();

}

};

game_sound.loadSound("pagechangeSFX2.mp3", false);

Any thoughts?

Thanks,

Scott

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 16, 2017 Jan 16, 2017

that should be void.  actionscript 3 is case-sensitive.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 16, 2017 Jan 16, 2017

More error codes:

1120 Access of undefined property percent

Here is the code block it is referencing:

percent = Math.floor(getBytesLoaded()/getBytesTotal()*100);

loadingPercent.text = percent + " %";

Also,

1180 Call to an undefined method getbytestloaded

Code:

percent = Math.floor(getBytesLoaded()/getBytesTotal()*100);

loadingPercent.text = percent + " %";

Also,

1120 Access of undefined property progressBar_mc

Code:

//create clips to hold your content

this.createEmptyMovieClip("progressBar_mc", 0);

progressBar_mc.createEmptyMovieClip("bar_mc", 1);

progressBar_mc.createEmptyMovieClip("stroke_mc", 2);

//use drawing methods to create a progress bar

with (progressBar_mc.stroke_mc) {

lineStyle(0, 0x000000);

moveTo(0, 0);

lineTo(100, 0);

lineTo(100, 10);

lineTo(0, 10);

lineTo(0, 0);

}

with (progressBar_mc.bar_mc) {

beginFill(0xFF0000, 100);

moveTo(0, 0);

lineTo(100, 0);

lineTo(100, 10);

lineTo(0, 10);

lineTo(0, 0);

endFill();

_xscale = 0;

}

progressBar_mc._x = 2;

progressBar_mc._y = 1143;

// load progress

var mclListener:Object = new Object();

mclListener.onLoadStart = function(target_mc:MovieClip) {

progressBar_mc.bar_mc._xscale = 0;

};

mclListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {

progressBar_mc.bar_mc._xscale = Math.round(bytesLoaded/bytesTotal*100);

};

mclListener.onLoadComplete = function(target_mc:MovieClip) {

progressBar_mc.removeMovieClip();

};

mclListener.onLoadInit = function(target_mc:MovieClip) {

target_mc._height = 500;

target_mc._width = 700;

};

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 16, 2017 Jan 16, 2017

to solve that percent error, use:

var percent:Number = Math.floor(this.loaderInfo.bytesLoaded/this.loaderInfo.bytesTotal*100);

for your progressBar_mc error, you need to define progressBar_mc either on stage or in code.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 16, 2017 Jan 16, 2017

Next errors:

Error Message:

1172: Definition mx.transitions:Tween could not be found

1172: Definition mx.transitions.easing could not be found

Code:

import mx.transitions.Tween;

import mx.transitions.easing.*;

var myHoriTween:Tween = new Tween (Logo_OFF_mc,"_x",Strong.easeOut,-450,-83,2,true);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 16, 2017 Jan 16, 2017

that should be:

import fl.transitions.Tween;

import fl.transitions.easing.*;

(p.s when using the adobe forums, please mark helpful/correct responses, if there are any.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 16, 2017 Jan 16, 2017

Thanks, kglad!

Here is the next issue:

Error Message:

1067: Implicit coercion of a value of type int to an unrelated type string

Code:

if (percent ==100){

gotoAndPlay("animation",1);

}else{

gotoAndPlay(1);

}

Also, kglad I would be interested in paying you to clean up all the code on this website if you are interested.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 16, 2017 Jan 16, 2017
LATEST

Thanks, kglad!

Here is my next issue:

Error Message:

1067: Implicit coercion of a value of type int to an unrelated type string

Code:

if (percent ==100){

gotoAndPlay("animation",1);

}else{

gotoAndPlay(1);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines