Hello all you AS3 junkies, I hope your coding is going quite well. I wish I could say the same for myself but I’m fairly new to this so mistakes arise more often than not. This one in particular has me stumped even though I might know exactly where it is, just not what it is. I have an image gallery thats a group of links that plays on a timeline. It scrolls and repeats, giving a smooth continuity. I’ve set up and ENTER_FRAME event to a listener of the stage, a Boolean variable based on mouseY conditionals for true and false, and passed a true value to mouseX conditionals that controls the timeline with prevFrame() and nextFrame() methods.
All is fine in the original swf, but once I load it into my flash page those mouseX and mouseY values no longer represent the stage upon which the swf was originally created, that stage doesn’t exist. Instead its new parents stage has spanned those parameters far across the page, even making it possible to control playback outside of the page itself. How can I either separate the swf’s stage from its parent or re-establish the parameters I had originally set for it?
This is the code for both, First is the Flash Page, the SWF in question is highlighted,
var swfRequest:URLRequest = new URLRequest("NewsandLinks.swf");
var swfLoader:Loader = new Loader();
swfLoader.load(swfRequest);
var swfRequest2:URLRequest = new URLRequest("Slideshow2a.swf");
var swfLoader2:Loader = new Loader();
swfLoader2.load(swfRequest2);
[COLOR=#0000ff]***var swfRequest3:URLRequest = new URLRequest("PartnersMain.swf");
var swfLoader3:Loader = new Loader();
swfLoader3.load(swfRequest3);***[/COLOR]
NewsLinksCont_mc.addChild(swfLoader);
SlideShowCont_mc.addChild(swfLoader2);
[COLOR=#0000ff]***PartnersCont_mc.addChild(swfLoader3);***[/COLOR]
NewsLinksContMask_mc.cacheAsBitmap = true;
NewsLinksCont_mc.cacheAsBitmap = true;
NewsLinksCont_mc.mask = NewsLinksContMask_mc;
SlideShowContMask_mc.cacheAsBitmap = true;
SlideShowCont_mc.cacheAsBitmap = true;
SlideShowCont_mc.mask = SlideShowContMask_mc;
PartnersContMask_mc.cacheAsBitmap = true;
PartnersCont_mc.cacheAsBitmap = true;
PartnersCont_mc.mask = PartnersContMask_mc;
Second is the Original SWF Flash,
var myVar:Boolean = false
stage.addEventListener(Event.ENTER_FRAME, move1);
function move1(event:Event):void
{
if(mouseY>154 && mouseY<209)
{
myVar = false;
Bar_mc.play();
}
if(mouseY>0 && mouseY<44)
{
myVar = false;
Bar_mc.play();
}
if(mouseY>44 && mouseY<154)
{
myVar = true;
}
if(mouseX<58 && myVar == true)
{
Bar_mc.prevFrame();
Bar_mc.prevFrame();
}
if(mouseX>254 && myVar == true)
{
Bar_mc.nextFrame();
Bar_mc.nextFrame();
}
}