Skip to main content
Participating Frequently
April 8, 2013
Question

URGENT HELP PLEASE! combining two scenes with the same code

  • April 8, 2013
  • 1 reply
  • 1336 views

hello everyone , im working on an interactive application on flash cs6 - actionscript 3

im supposed to make the same application with 2 languages

so basically i created two different FLA files ... one in english and the other one in foreign language

when i try to add the scenes to be combined in one FLA , it gives me errors of duplication of the actionscript

my project contains a carousel... i thought of saving one of the FLA as a movie and add it somehow to the second fla , but i didnt know how to combine them with a button..

PLEASE HELP!

when i try to give unique names it gives errors.. ( im not a proffessional in actionscript 3 ) i hope i made myself clear...!

the code of the english fla is

import com.ccanvas.carousel.*;


var centerX:Number = stage.stageWidth/4;
var centerY:Number = stage.stageHeight/4;
var carc:Carousel = new Carousel(centerX, centerY, 256, 75, "icons.xml");
carc.addTooltip(new tooltip);
addChild(carc);

function down(event:MouseEvent):void {
trace(event.currentTarget.toolText);
}

function destroyCarousel(event:MouseEvent):void {
carc.destroy();
}

function removeNextItem(event:MouseEvent):void {
if(carc.numOfItems > 2) {
  carc.removeItem(2);
}
}
create.addEventListener("mouseDown", createCarousel);

function createCarousel(event:MouseEvent):void {
if(carc.CREATED == false) {
 
  carc = new Carousel(centerX, centerY, 256, 75, "icons.xml");
  carc.addTooltip(new tooltip);
  addChild(carc);
}
}

Tools_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene);

function fl_ClickToGoToScene(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Toolse");
}

games_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToGames);

function fl_ClickToGoToGames(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Gamese");
}

Identity_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToIdentity);

function fl_ClickToGoToIdentity(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Identitye");
}

Reviews_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_13);

function fl_ClickToGoToScene_13(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Reviewse");
}

Facts_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_20);

function fl_ClickToGoToScene_20(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Factse");
}

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 8, 2013

1. use your two fla files to publish two working swfs, one in each language.

2. create a new fla that will be your main fla.  add two buttons that allow the user to select the language they want to use.

3. assign code to the buttons to load (ie, use the loader class) the corresponding swf published in step 1.

Participating Frequently
April 10, 2013

thank you for your reply! if i want to put another button so that they can go back from the swfs to the main page to change the language how can i do that ?? help appreciated and thanks alot in advance

kglad
Community Expert
Community Expert
April 10, 2013

if that button is on the main timeline of the two swfs, you could use:

return_btn.addEventListener(MouseEvent.CLICK,returnF);

function returnF(e:MouseEvent):void{

this.loaderInfo.loader.unloadAndStop();

}