I have a serious issue owing to a 6 month gap between creating the problem and recognizing the problem. Back at the beginning of the year, I was asked to add some graphics and change some text in a flash only website. The site was quite complex and I certainly was not/am not up to the level to create such code from scratch, but I did have some prior experience with Flash and seemingly was able to add the graphics and update some of the internal text. In the process of adding the graphics, I had to enlarge the main_mc which contained all the elements, including the new ones. Unknown to me at the time, but now discovered, changing the properties of the main_mc symbol seems to have disabled a complex Tweening action created in a separate Main.ac file. I did not touch the Main.ac file and I did not make any code changes to the corresponding FLA file which contains the main_mc and new graphics, but I have determined that somehow these changes have put the crimp on the tween because I have put an older version of Main.swf into my development environment and the actions work again (even though they are triggered by children SWF files).
Here is the code from the class file that I think is tied up in the this:
public function showSamples(event:Event = null):void
{
// create new timeline to allow us to move the desk elements back into place
showSamplesTimeline = new TimelineMax({onReverseComplete: resetSamples});
// create array of all desk elements
var deskElements:Array = /* of TweenMax */ [
TweenMax.to(main_mc.memorandum_mc, 1, {x: main_mc.memorandum_mc.x - 1700}),
TweenMax.to(main_mc.phone_mc, 1, {x: main_mc.phone_mc.x - 1700}),
TweenMax.to(main_mc.todo_mc, 1, {x: main_mc.todo_mc.x - 1900}),
TweenMax.to(main_mc.menuMask_mc, 1, {x: main_mc.menuMask_mc.x - 1700}),
TweenMax.to(main_mc.menu_mc, 1, {x: main_mc.menu_mc.x - 1700}),
TweenMax.to(main_mc.flags_mc, 1, {x: main_mc.flags_mc.x - 1700}),
TweenMax.to(main_mc.clocks_mc, 1, {x: main_mc.clocks_mc.x - 1700}),
TweenMax.to(main_mc.device_mc, 1, {x: main_mc.device_mc.x - 1700}),
TweenMax.to(main_mc.content_mc, 1, {x: main_mc.content_mc.x - 1700}),
TweenMax.to(main_mc.coffeeContainer_mc, 1, {x: main_mc.coffeeContainer_mc.x - 1700})
];
main_mc.printer_mc.translate_btn.mouseEnabled = false;
/*
var memorandumTween:TweenMax = ;
var memorandum_mc,
var phone_mc,
var todo_mc,
var menuMask_mc,
var menu_mc,
var flags_mc,
var clocks_mc,
main_mc.device_mc,
main_mc.content_mc,
main_mc.coffeeContainer_mc
*/
// tween all desk elements out out of the state somewhere...
showSamplesTimeline.insertMultiple(deskElements);
//showSamplesTimeline.insertMultiple(TweenMax.allTo(deskElements, 1, {x:-400}));
// bring in the printer element for printn' out samples... arrgh!
showSamplesTimeline.insert(TweenMax.fromTo(main_mc.printer_mc, 0.5, {x: 2000, y: -140},{x: 800, y: -140.0, delay: 0.25}));
showSamplesTimeline.append(TweenMax.to(main_mc.printer_mc, 0.5, {y: -340.0, delay: 0.25, onComplete: showGermanSample}));
}
/**
*
*/
public function showGermanSample():void
{
// create short reference to the loader content
var container = main_mc.printer_mc.paper_mc.getChildAt(0).contentLoaderInfo.content;
// move the scroller out of view
container.scroller.x = 2000;
// hide the english translation
container.germanContentDropShadow_mc.visible = false;
container.englishContentDropShadow_mc.visible = false;
container.content_mc.englishContent_mc.visible = false;
// tween the paper into view and when complete put the scroller next to the german sample
TweenMax.to(main_mc.printer_mc.paper_mc, 1, {
y: 443,
onComplete: function():void
{
container.scroller.x = 599;
container.germanContentDropShadow_mc.visible = true;
main_mc.printer_mc.translate_btn.mouseEnabled = true;
}
});
}
/**
*
*/
public function showEnglishSample(event:Event = null):void
{
// create short reference to the loader content
var container = main_mc.printer_mc.paper_mc.getChildAt(0).contentLoaderInfo.content;
// move the scroller out of view
container.scroller.x = 2000;
// move the paper to make room for the english content
TweenMax.to(main_mc.printer_mc.paper_mc, 0.5, {x: -454});
// show the english sample
container.content_mc.englishContent_mc.visible = true;
// tween the english sample into view and when complete put the scoller next to the english sample
TweenMax.from(container.content_mc.englishContent_mc, 1, {
y: -1000,
delay: 0.5,
onComplete: function():void
{
container.scroller.x = 1210;
container.englishContentDropShadow_mc.visible = true;
main_mc.printer_mc.translate_btn.mouseEnabled = false;
}
});
// tween the paper
TweenMax.to(main_mc.printer_mc.paper_mc, 0.5, {x: -142, delay: 1.5});
}
/**
*
*/
public function hideSamples(event:Event = null):void
{
// back to the future
showSamplesTimeline.reverse();
}
/**
*
*/
public function resetSamples(event:Event = null):void {
// unload sampleContentLoader
sampleContentLoader.unload();
// reset position
main_mc.printer_mc.paper_mc.x = 164;
main_mc.printer_mc.paper_mc.y = -600;
trace(main_mc.printer_mc.x);
trace(main_mc.printer_mc.y);
// remove loader content
main_mc.printer_mc.paper_mc.removeChildAt(0);
// kill tweens
showSamplesTimeline.kill();
}
At the risk of some public embarrassment for myself and my client, but because I could really use the help, here is the live website: (removed)
Navigate to (in English) Services -> Samples. You can click on the buttons, e.g. Legal, and it will drill down to the sample topic. In the old working version, you would click on the final topic, e.g. Litigation, and the screen would animate to stage-right and you would be presented with an image of a document in english appearing to come out of a printer. Then the user could hit the translate button and a second image in German would come out. Clicking on Choose Again would animate you stage-left back to the primary screen. Of course, this isn't working.
I've put a working version up at a dev location: (removed)
I will probably remove the dev copy in a day or so.
I would really appreciate some help on sorting this out.
[edit] I should probably add that the old main_mc was 2359x1692 and the new one is 2967.65x1939.35. The location on the stage is the same: -800 x 0. Not exactly sure how the new dimensions were arrived at as it was 6 months ago now, but enlargement was required to fit the extra graphic elements. The client required a large area from the original developer to look nice on widescreen monitors.
Thanks.