Skip to main content
jacquelynm24125526
Participating Frequently
June 19, 2015
Question

How do I move text between frames?

  • June 19, 2015
  • 1 reply
  • 371 views

In my project I have 24 different frames with different visual content. On frame one I have a dynamic text box that is supposed to display a currently selected list item. On frame 24 is the selection list with 4 options to choose. I am wanting the content of a different box to be assigned back to frame 1 when pressed on frame 24. My code for both frames is below. Any suggestions are appreciated.

Frame 1

var stateLast: int = 1;

var SChem: String = 'Chem1';

var c1: String = 'Chem1';

var c2: String = 'Chem2';

var c3: String = 'Chem3';

var c4: String = 'Chem4';

var modeLast: int = 1;

SelectedChem.text = SChem;

function SelectC1(event:MouseEvent): void {

  SChem = c1;

  SelectedChem.text = SChem;

  trace(SelectedChem);

}

function SelectC2(event:MouseEvent): void {

  SChem = c2;

  SelectedChem.text = SChem;

  trace(SelectedChem);

}

function SelectC3(event:MouseEvent): void {

  SChem = c3;

  SelectedChem.text = SChem;

  trace(SelectedChem);

}

function SelectC4(event:MouseEvent): void {

  SChem = c4;

  SelectedChem.text = SChem;

  trace(SelectedChem);

}

Frame 24

Chem1.text = c1;

Chem2.text = c2;

Chem3.text = c3;

Chem4.text = c4;

HomeBtn.addEventListener(MouseEvent.CLICK, GoHome);

sc1.addEventListener(MouseEvent.CLICK, SelectC1);

sc2.addEventListener(MouseEvent.CLICK, SelectC2);

sc3.addEventListener(MouseEvent.CLICK, SelectC3);

sc4.addEventListener(MouseEvent.CLICK, SelectC4);

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
June 19, 2015

if you want to use SelectedChem.text in a frame where SelectedChem doesn't exist, assign SelectedChem.text to a variable and use that variable similar to what you're already doing with c1 etc.

jacquelynm24125526
Participating Frequently
June 19, 2015

SelectedChem is the dynamic text box on frame 1 only. Chem1-4 are visual labels with buttons sc1-4 ontop. Later I plan to make them editable on a different screen and need them to be able to change when the user edits that field but for now I am still trying to learn to manipulate text with AS3 in Flash.