OK, I've been brought to one knee, and now I'm asking for your combined elearning superpowers to save me.
I have a .swf that I have imported into Presenter. When not in Presenter, it works wonderfully. When imported into Presenter, it makes me sad. Observe:
You're using _root to control positioning:-) That's a no-no cuz it conflicts with Presenter's player coding which also references _root. Here's more info Flash best practices in Presenter 09.
Is that your code? Can you modify to make the references relative instead of absolute?
9 Replies
Craig - is there any way you can post your Flash file? I've seen files shift a pixel or two but never across the slide like that.
stop();
speed = 10;
initial_width = 60;
target_width = 678;
sp = rect1._x;
this.createEmptyMovieClip("emptymc", 0);
emptymc.onEnterFrame = function() {
for (i=1; i
if (_root.hit.hitTest(_root._xmouse, _root._ymouse, true)) {
if (_root["rect"+i].hitTest(_root._xmouse, _root._ymouse, true)) {
new_x = (_root.sp-(60*(i-1)))-rect1._x;
rect1._x += new_x/speed;
n_width = target_width-_root["rect"+i]._width;
_root["rect"+i]._width += n_width/speed;
} else {
n_width2 = initial_width-_root["rect"+i]._width;
_root["rect"+i]._width += n_width2/speed;
}
} else {
new_x = _root.sp-rect1._x;
rect1._x += new_x/(speed+50);
n_width2 = initial_width-_root["rect"+i]._width;
_root["rect"+i]._width += n_width2/(speed-1);
}
_root["rect"+(i+1)]._x = _root["rect"+i]._x+_root["rect"+i]._width;
_root["movie"+i]._x = _root["rect"+i]._x-1;
}
};
...a colleague helped me to see that the problem might be with the first 'if' line:
if (_root.hit.hitTest(_root._xmouse, _root._ymouse, true)) {
as the item hit is a movie clip that is used multiple times on the stage. Again, works fine standalone, but not so much in Presenter.
Oh, well I already see some potential issues
You're using _root to control positioning:-) That's a no-no cuz it conflicts with Presenter's player coding which also references _root. Here's more info Flash best practices in Presenter 09.
Is that your code? Can you modify to make the references relative instead of absolute?
Hi Craig,
Have you tried inserting the SWF as a web object? This would workaround any ActionScript conflicts that you may have:
https://player.vimeo.com/video/143914206
For reference, here's a list of SWF file best practices that may help you troubleshoot the issue:
http://www.articulate.com/support/presenter09/kb/?p=76
David: aha! That seems like it might be it.
Brian: I haven't, but I'll give that a try as well.
Thanks guys - I'll repost once I have the winning formula.
The web object would be the simplest way since you won't have to touch your code.
But please let us know what you go with and how it turns out.
David and Brian: you were right - the web object was the fasted way to a safe interaction. Thanks for your help!
That said, I am going to try to modify the code anyway, since it would be nice to get this to work 'straight' using AS2.
Glad to hear that the web object method worked for you!
So, did it work for you in the end? Embedding web object is no solution in my case. Here's my workaround but I'd like to know the proper way to reference movieclips: http://community.articulate.com/forums/p/10555/62439.aspx
This discussion is closed. You can start a new discussion or contact Articulate Support.