Skip to main content
Known Participant
January 25, 2013
Question

How to run a function from a scripted MC

  • January 25, 2013
  • 1 reply
  • 365 views

I haven't used AS1 in a while and I do not know why my code isn't working and I don't knnow how to fix it, I have been playing around with it and trying to figure out how to get to a function or run a function which is on the main timline from an mc or even just skip to that code (since its the last frame of my MC) the MC includes nothing but actionscript to gather information to save/create a .txt file.

Basically how can I run a function on the main timeline from where I am now?

if (_root.ssFileSave != "?") {

_root.filename = _root.ssFileSave;

_root.onsaver();

onsaver is the function I am trying to run and I have tried all sorts to get it working properly :S

win 7 cs5 as1 (+using SWF studio which I am using to create and save file(s))

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
January 25, 2013

if onsaver is defined on the _root timeline AND it has been defined when that code executes (use trace functions to confirm), then

_root.onsaver();  // is correct coding