I am trying to add one more video to a flash file that contains 2 already. I am new to actionscript, and have been actually learning as3. the file i need to update is in as2. it looks like its within the if else statements area, but i don’t know actionscript well enough to complete this. can anyone help, please? the code is below. the file recognizes a “slide1” and “slide4” right now, but i also need it to recognize a “slide5”. thanks!
current code:
function updatePosition()
{
if (_root._xmouse > Stage.width - 1 || _root._xmouse < 1)
{
stopDrag();
delete (_root.onEnterFrame);
}
var __reg4 = 50;
var __reg3 = (_root.arrow._x - 60) / _root.bar._width;
if (_global.lastPercent != __reg3)
{
gs.TweenMax.to(_root.container, 1, {_x: 0 - (_root.container._width - 260) * __reg3 + __reg4, ease: gs.easing.Cubic.easeOut, overwrite: true, onUpdate: optimize});
}
_global.lastPercent = __reg3;
}
function optimize()
{
i = 0;
while (i < _root.container.totalSlides)
{
if (_root.container[“slide” + i].hitTest(_root.container_mask) == true)
{
_root.container[“slide” + i]._visible = true;
}
else
{
_root.container[“slide” + i]._visible = false;
}
++i;
}
if (_root.container.slide1.my_video.hitTest(_root.container_mask) == true)
{
if (_root.container.slide1.my_video.isPlaying == false)
{
trace(“playing video 1”);
gs.TweenMax.delayedCall(0.5, playVideo1);
}
_root.container.slide1.my_video.isPlaying = true;
}
else
{
gs.TweenMax.delayedCall(0.25, stopVideo1);
_root.container.slide1.my_video.isPlaying = false;
}
if (_root.container.slide4.my_video.hitTest(_root.container_mask) == true)
{
if (_root.container.slide4.my_video.isPlaying == false)
{
trace(“playing video 2”);
gs.TweenMax.delayedCall(0.5, playVideo2);
}
_root.container.slide4.my_video.isPlaying = true;
return;
}
gs.TweenMax.delayedCall(0.25, stopVideo2);
_root.container.slide4.my_video.isPlaying = false;
}
function stopVideo1()
{
_root.container.slide1.my_video.stop();
}
function setVolume()
{
trace(_root.mySound.myVolume);
}
function playVideo1()
{
_root.container.slide1.my_video.play();
}
function stopVideo2()
{
_root.container.slide4.my_video.stop();
}
function playVideo2()
{
_root.container.slide4.my_video.play();
}
optimize();
arrow.onPress = function ()
{
startDrag(this, 0, 63, 635, 670, 635);
_root.onEnterFrame = function ()
{
updatePosition();
}
;
}
;
arrow.onRelease = function ()
{
stopDrag();
delete _root.onEnterFrame;
}
;