Buttons in swf not working when inserted into course

Hey there Heroes!

I am having an issue with a swf interaction file that I am trying to embedd as a flash movie object in Articulate Presenter. 

Background- the swf is a type of "rollover" interaction of a few different product shots with hot spots so when the user rolls over them, it gives them more information and possibly an animation. This was given to us from our customer. 

When I test the swf outside of articulate, all of the buttons work fine. Then when I place it in to articulate, the bottom buttons stop working, yet the rollovers still work. 

I wasn't able to see if the swf we got from our customer was AS 2.0 or 3.0, but I'm suspecting that this is the issue. 

Who here is a hero and can give me an answer? 

Thanks in advance! 

10 Replies
Madison  Wellington

steve mcmillen said:

If they are using '_root' references in there code that will cause problems?  That will be a difficult one to diagnose if you don't have access to the FLA files.


I got access to the .FLA file... 

There are references to _root all over the place. Mainly on the buttons

"btn_durext.onRelease = 

function ()

{

    _root.gotoAndPlay(3);

}"

is there a way to modify this to not have _root references?  

steve mcmillen

Have to put my head back into ActionScript 2 mode (sound of gears changing).

on the main timeline of your FLA file enter something like this...

_global.topLevel = this;

then anywhere you see a reference to '_root' change it to '_global.topLevel'

I spend most of my time using AS3 (which of course means it is for content other than Articulate, but if i remember correctly that should do the trick for you.

Issue is that when this custom SWF file is in the Articulate player _root is now referring to the top level of the Articulate player, not the top layer of the custom SWF.  So with the code above we are just creating a global variable that remembers the location of the top of the custom SWF so that when the buttons reference it they are addressing the right level in the flash sandwich.  

Hope that helps.

Madison  Wellington

Hi Steve, or anyone else who is a hero with Actionscript. 

So I replaced all references to "_root" with "_global.toplevel"

Here is what my code looks like. 

stop();

_global.toplevel=this;

btn_durext.onRelease = 

function ()

{

    _global.toplevel.gotoAndPlay(3);

}

btn_durint.onRelease = 

function ()

{

    _global.toplevel.gotoAndPlay(4);

}

btn_quiet.onRelease = 

function ()

{

    _global.toplevel.gotoAndPlay(5);

}

btn_betterair.onRelease = 

function ()

{

    _global.toplevel.gotoAndPlay(6);

}

btn_custex.onRelease = 

function ()

{

    _global.toplevel.gotoAndPlay(7);

}

btn_efficient.onRelease = 

function ()

{

    _global.toplevel.gotoAndPlay(8);

}

Now my problem is that the buttons seem to be flashing (I'm thinking they are reloading?) How can I stop this? 

steve mcmillen

hard to say to much more without knowing more about the structure of the file. I double checked what I told you and that code is sound.  Though with the gotoAndPlay commands as soon as say 'btn_durext' is pressed then it will jump and start playing from frame 3 and then of course immediately go to frame 4 and 5 and on until the end of the timeline or a stop command is given.  Now this could be entirely what is intended but without knowing a bit more it's hard to say.

Are the buttons just on a keyframe on frame 1? or do they exist along the entire timeline?

I'll do the best I can to help you out, just a bit challenging without seeing the file.

Madison  Wellington

Thanks! It so happened the buttons that were in there were movie clips, so they were looping their load sequence. I went through and changed them all to buttons and they stopped flashing. 

I really appreciate the help! The _global.toplevel fix seemed to work, as i'm able to click through to all the buttons now. 

Much appreciated, 

Madison Wellington

Henry Fuller

Help me! I have a similar problem. 

I have created a drag and drop interaction, where the colour of the "reactive strip area" changes when the user drops the syringe on it.

When I import and preview the swf in Articulate, the colour change no longer happens... I have changed all "_root" references to "_global.topLevel", as suggested above and still no joy!

Can anybody help a noob?