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

f() duplicated

Contributor ,
Apr 07, 2012 Apr 07, 2012

Copy link to clipboard

Copied

Hello

I have the same f() in frame 1 and frame 2, and when I play the movie again, it says f() dupliicated.

How can change it in the second frame, not to be the same. Here is the f()

function onEnterFrame(event:Event):void
{

domystuff;
}

TOPICS
ActionScript

Views

729

Translate

Translate

Report

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

LEGEND , Apr 07, 2012 Apr 07, 2012

Don't use the same function name, or just use the one from frame 1 if they both do the same thing... just have frame 1 extend thru frame 2

Votes

Translate

Translate
LEGEND ,
Apr 07, 2012 Apr 07, 2012

Copy link to clipboard

Copied

Don't use the same function name, or just use the one from frame 1 if they both do the same thing... just have frame 1 extend thru frame 2

Votes

Translate

Translate

Report

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
Contributor ,
Apr 07, 2012 Apr 07, 2012

Copy link to clipboard

Copied

How can I keep the same function doing the same thing by changing the name ? Particularly this function, how can I do it ?

function onEnterFrame(event:Event):void
{

dosamestuff;
}

Votes

Translate

Translate

Report

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
Contributor ,
Apr 07, 2012 Apr 07, 2012

Copy link to clipboard

Copied

I just changed the name of the f(). Problem solved. Thank you.

Votes

Translate

Translate

Report

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
LEGEND ,
Apr 07, 2012 Apr 07, 2012

Copy link to clipboard

Copied

You can use a function that is in frame 1 even in frame 2 if you extend it along the layer.  Just like if you wanted an object to span across frames, you can do the same with code elements like functions and variables.

Votes

Translate

Translate

Report

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
Contributor ,
Apr 08, 2012 Apr 08, 2012

Copy link to clipboard

Copied

LATEST

Thank you Ned. You are right, both ways. Thanks to your input, now I can make my record  flip to side number 2 and play the second song.

Votes

Translate

Translate

Report

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