Copy link to clipboard
Copied
OUTPUT ERROR
TypeError: Error #1010: A term is undefined and has no properties.
at tm.template::PagesEngine/tm.template:PagesEngine::createGalleryEngine()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at ()
at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
at flash.utils::Timer/flash.utils:Timer::tick()
Compiler error
Warning: 1100: Assignment within conditional. Did you mean == instead of =?
if (loc4 = arg1.viewPort.viewportObjectFilter.testObject(loc2))
if (loc4 = arg1.viewPort.viewportObjectFilter.testObject(loc2))
if (loc42 = (loc41 = renderMat as org.papervision3d.materials.MovieMaterial).rect)
if (loc5 = loc1.getBitmap(com.adobe.crypto.MD5.hash(images[loc3].url)))
if (loc3 = contentsMovieClip.getChildByName("text_" + loc1) as flash.text.TextField)
1 Correct answer
if-statements should use the double equal (==) to test for equality.
and on line 690 of PagesEngine.as you have an error.
Copy link to clipboard
Copied
if-statements should use the double equal (==) to test for equality.
and on line 690 of PagesEngine.as you have an error.
Copy link to clipboard
Copied
when swf file run than dis error's come
TypeError: Error #1010: A term is undefined and has no properties.
at tm.template::PagesEngine/::createGalleryEngine()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at MethodInfo-71()
at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
at flash.utils::Timer/flash.utils:Timer::tick()
template.as----------
package tm
{
import br.com.stimuli.loading.*;
import caurina.transitions.*;
import com.adobe.crypto.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.utils.*;
import tm.com.*;
import tm.template.*;
public class Template extends flash.display.MovieClip
{
public function Template()
{
var loc1:*;
loc1 = null;
var loc2:*;
loc2 = null;
var loc3:*;
loc3 = null;
var loc4:*;
loc4 = null;
_applicationStarted = false;
_mainXMLLoaded = false;
_galleriesXMLLoaded = false;
_assetsLoaded = false;
_assetsPercentLoaded = 0;
super();
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 7, frame8, 39, frame40, 44, frame45);
stage.align = flash.display.StageAlign.TOP_LEFT;
stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
stage.addEventListener(flash.events.Event.RESIZE, appResizeHandler);
loc1 = new flash.net.URLLoader();
loc1.addEventListener(flash.events.Event.COMPLETE, onMainXMLLoad);
loc1.load(new flash.net.URLRequest(tm.com.TemplateConfiguration.MAIN_XML_PATH));
loc2 = new flash.net.URLLoader();
loc2.addEventListener(flash.events.Event.COMPLETE, onGalleryXMLLoad);
loc2.load(new flash.net.URLRequest(tm.com.TemplateConfiguration.GALLERIES_XML_PATH));
addEventListener("applicationResize", appResizeHandler);
addEventListener("switchFullScreen", switchFullScreen);
addEventListener("switchSound", switchSound);
addEventListener("switchPage", onSwitchPage);
addEventListener("getURL", onGetURL);
onApplicationResize();
loc3 = new br.com.stimuli.loading.BulkLoader("mainLoader");
loc3.addEventListener(br.com.stimuli.loading.BulkLoader.COMPLETE, onAssetsLoaded);
loc3.addEventListener(br.com.stimuli.loading.BulkLoader.PROGRESS, onAssetsProgress);
loc3.addEventListener(br.com.stimuli.loading.BulkErrorEvent.ERROR, onAssetsError);
(loc4 = new flash.utils.Timer(tm.com.TemplateConfiguration.APPLICATION_PRELOADER_UPDATE_TIME)).addEventListener(flash.events.TimerEvent.TIMER, appLoadingHandler);
loc4.start();
return;
}
public function registerCompanyName():void
{
if (companyNameHolder)
{
companyNameHolder.cn.cnHolder.companyName.cn.tf.htmlText = tm.com.TemplateState.getInstance().settings["companyName"];
companyNameHolder.cn.cnHolder.button.width = companyNameHolder.cn.cnHolder.companyName.cn.tf.textWidth + 10;
companyNameHolder.cn.cnHolder.button.buttonMode = true;
companyNameHolder.cn.cnHolder.button.useHandCursor = true;
companyNameHolder.cn.cnHolder.button.addEventListener(flash.events.MouseEvent.CLICK, companyNameClickHandler);
}
return;
}
private function textLinkClick(arg1:flash.events.TextEvent):void
{
var loc1:*;
loc1 = null;
loc1 = tm.com.TemplateUtils.getTEventFromString(arg1.text, true);
if (loc1)
{
dispatchEvent(loc1);
}
return;
}
private function onBackgroundSoundUpdate(arg1:flash.events.Event):void
{
_backgroundSoundTransform = _templateBackgroundSound.soundTransform;
_backgroundSoundChannel = _templateBackgroundSound.soundChannel;
return;
}
private function appLoadingHandler(arg1:flash.events.TimerEvent):void
{
var loc1:*;
loc1 = undefined;
var loc2:*;
loc2 = undefined;
var loc3:*;
loc3 = NaN;
loc1 = stage.loaderInfo.bytesTotal;
loc2 = stage.loaderInfo.bytesLoaded;
loc3 = Math.floor((Math.round(loc2 * 100 / loc1) + Math.round(_assetsPercentLoaded * 100)) / 2);
preloader.preloader.gotoAndStop(loc3);
if (loc2 >= loc1 && _assetsLoaded && _mainXMLLoaded && _galleriesXMLLoaded)
{
flash.utils.Timer(arg1.currentTarget).stop();
flash.utils.Timer(arg1.currentTarget).removeEventListener(flash.events.TimerEvent.TIMER, appLoadingHandler);
onApplicationLoaded();
}
return;
}
private function onSwitchPage(arg1:tm.com.TemplateEvent):void
{
var loc1:*;
loc1 = NaN;
var loc2:*;
loc2 = NaN;
if (_pagesEngine)
{
loc1 = arg1.info[0];
loc2 = arg1.info[1];
if (loc2 >= 0)
{
tm.com.TemplateState.getInstance().currentReadMorePage = loc2;
}
_pagesEngine.switchPage(loc1);
}
return;
}
private function onApplicationResize():void
{
resize(Math.max(stage.stageWidth, tm.com.TemplateConfiguration.MIN_TEMPLATE_WIDTH), Math.max(stage.stageHeight, tm.com.TemplateConfiguration.MIN_TEMPLATE_HEIGHT));
return;
}
private function switchFullScreen(arg1:flash.events.Event=null):void
{
if (stage.displayState != flash.display.StageDisplayState.NORMAL)
{
stage.displayState = flash.display.StageDisplayState.NORMAL;
}
else
{
stage.displayState = flash.display.StageDisplayState.FULL_SCREEN;
}
return;
}
private function switchSound(arg1:flash.events.Event=null):void
{
if (_templateBackgroundSound)
{
_backgroundSoundTransform = _templateBackgroundSound.soundTransform;
_backgroundSoundChannel = _templateBackgroundSound.soundChannel;
}
if (tm.com.TemplateState.getInstance().soundEnabled)
{
bottomControls.sound.holder.soundButtonOn.visible = false;
bottomControls.sound.holder.soundButtonOff.visible = true;
tm.com.TemplateState.getInstance().soundEnabled = false;
caurina.transitions.Tweener.addTween(_backgroundSoundTransform, {"volume":0, "time":3, "onUpdate":updateSoundVolume});
}
else
{
bottomControls.sound.holder.soundButtonOn.visible = true;
bottomControls.sound.holder.soundButtonOff.visible = false;
tm.com.TemplateState.getInstance().soundEnabled = true;
caurina.transitions.Tweener.addTween(_backgroundSoundTransform, {"volume":1, "time":1.5, "onUpdate":updateSoundVolume, "transition":"easeInQuart"});
}
return;
}
private function onApplicationLoaded():void
{
preloader.preloader.gotoAndPlay("hide");
tm.com.TemplateUtils.callFunctionWithDelay(startApplication, tm.com.TemplateConfiguration.START_APPLICATION_DELAY);
return;
}
private function buttonRollOutHandler(arg1:flash.events.MouseEvent):void
{
arg1.currentTarget.gotoAndPlay("out");
return;
}
private function companyNameClickHandler(arg1:flash.events.MouseEvent):void
{
dispatchEvent(tm.com.TemplateUtils.getTEventFromString("switchPage,0"));
return;
}
function frame1():*
{
stop();
return;
}
private function appResizeHandler(arg1:flash.events.Event):void
{
onApplicationResize();
return;
}
function frame7():*
{
registerCompanyName();
return;
}
public function registerBottomControls():void
{
if (bottomControls)
{
bottomControls.fullScreen.holder.fullScreenButton.tf.htmlText = tm.com.TemplateState.getInstance().settings["fullScreen"];
bottomControls.fullScreen.holder.fullScreenButton.addEventListener(flash.events.MouseEvent.ROLL_OVER, buttonRollOverHandler);
bottomControls.fullScreen.holder.fullScreenButton.addEventListener(flash.events.MouseEvent.ROLL_OUT, buttonRollOutHandler);
bottomControls.fullScreen.holder.fullScreenButton.addEventListener(flash.events.MouseEvent.CLICK, switchFullScreen);
bottomControls.fullScreen.holder.fullScreenButton.buttonMode = true;
bottomControls.fullScreen.holder.fullScreenButton.useHandCursor = true;
bottomControls.sound.holder.soundButtonOn.tf.htmlText = tm.com.TemplateState.getInstance().settings["sound"];
bottomControls.sound.holder.soundButtonOff.tf.htmlText = tm.com.TemplateState.getInstance().settings["sound"];
bottomControls.sound.holder.soundButtonOn.addEventListener(flash.events.MouseEvent.ROLL_OVER, buttonRollOverHandler);
bottomControls.sound.holder.soundButtonOn.addEventListener(flash.events.MouseEvent.ROLL_OUT, buttonRollOutHandler);
bottomControls.sound.holder.soundButtonOn.addEventListener(flash.events.MouseEvent.CLICK, switchSound);
bottomControls.sound.holder.soundButtonOn.buttonMode = true;
bottomControls.sound.holder.soundButtonOn.useHandCursor = true;
bottomControls.sound.holder.soundButtonOff.addEventListener(flash.events.MouseEvent.ROLL_OVER, buttonRollOverHandler);
bottomControls.sound.holder.soundButtonOff.addEventListener(flash.events.MouseEvent.ROLL_OUT, buttonRollOutHandler);
bottomControls.sound.holder.soundButtonOff.addEventListener(flash.events.MouseEvent.CLICK, switchSound);
bottomControls.sound.holder.soundButtonOff.buttonMode = true;
bottomControls.sound.holder.soundButtonOff.useHandCursor = true;
bottomControls.sound.holder.soundButtonOff.visible = false;
bottomControls.copyright.copyright.tf.htmlText = tm.com.TemplateState.getInstance().settings["copyright"];
bottomControls.copyright.copyright.tf.addEventListener(flash.events.TextEvent.LINK, textLinkClick);
}
return;
}
private function updateSoundVolume():void
{
_backgroundSoundChannel.soundTransform = _backgroundSoundTransform;
return;
}
function frame8():*
{
onApplicationResize();
return;
}
private function startApplication():void
{
_applicationStarted = true;
gotoAndPlay("start");
new tm.com.TemplateSound("introSound").play();
tm.com.TemplateUtils.callFunctionWithDelay(playBackgroundMusic, tm.com.TemplateConfiguration.BACKGROUND_MUSIC_DELAY);
return;
}
private function buttonRollOverHandler(arg1:flash.events.MouseEvent):void
{
arg1.currentTarget.gotoAndPlay("over");
new tm.com.TemplateSound("arrowsSound").play();
return;
}
function frame5():*
{
registerBottomControls();
pagesEngine.show();
return;
}
private function onAssetsProgress(arg1:br.com.stimuli.loading.BulkProgressEvent):void
{
_assetsPercentLoaded = arg1._percentLoaded;
return;
}
private function onMainXMLLoad(arg1:flash.events.Event):void
{
var attribute:XML;
var attributesCollection:Object;
var element:XML;
var event:flash.events.Event;
var imageElement:XML;
var imagePath:String;
var mainData:XML;
var page:Object;
var parsedMenuItems:Array;
var parsedPages:Array;
var parsedReadMorePages:Array;
var parsedSettings:Object;
var parsedSounds:Object;
var readMoreImageElement:XML;
var readMoreImagePath:String;
var readMorePage:Object;
var skipAtTheEnd:Number;
var skipFromTheStart:Number;
var soundID:String;
var soundLoops:Number;
var soundPanning:Number;
var soundPath:String;
var soundVolume:Number;
var loc1:*;
mainData = null;
parsedSettings = null;
element = null;
parsedMenuItems = null;
parsedSounds = null;
soundID = null;
soundPath = null;
soundVolume = NaN;
soundLoops = NaN;
skipFromTheStart = NaN;
skipAtTheEnd = NaN;
soundPanning = NaN;
parsedPages = null;
attributesCollection = null;
attribute = null;
page = null;
imageElement = null;
imagePath = null;
parsedReadMorePages = null;
readMorePage = null;
readMoreImageElement = null;
readMoreImagePath = null;
event = arg1;
try
{
mainData = new XML(event.target.data);
if (mainData.settings)
{
parsedSettings = new Object();
var loc2:*;
loc2 = 0;
var loc3:*;
loc3 = mainData.settings.children();
for each (element in loc3)
{
parsedSettings[element.name().toString()] = element.text().toString();
}
tm.com.TemplateState.getInstance().settings = parsedSettings;
}
if (mainData.menu)
{
parsedMenuItems = new Array();
loc2 = 0;
loc3 = mainData.menu.elements();
for each (element in loc3)
{
parsedMenuItems.push({"label":element.text().toString(), "targetPage":element.targetPage, "click":element.click.toString()});
}
tm.com.TemplateState.getInstance().menu = parsedMenuItems;
}
if (mainData.sounds)
{
parsedSounds = new Object();
loc2 = 0;
loc3 = mainData.sounds.elements();
for each (element in loc3)
{
soundID = element.id;
soundPath = element.url;
soundVolume = 1;
if (element.volume && element.volume.toString().length > 0 && Number(element.volume) >= 0 && Number(element.volume) < 100)
{
soundVolume = Number(element.volume) / 100;
}
soundLoops = 0;
if (element.loops && element.loops.toString().length > 0 && Number(element.loops) >= 0 && Number(element.loops) < 99999)
{
soundLoops = Number(element.loops);
}
skipFromTheStart = 0;
if (element.skipFrom && element.skipFrom.toString().length > 0 && Number(element.skipFrom) >= 0)
{
skipFromTheStart = Number(element.skipFrom);
}
skipAtTheEnd = 0;
if (element.skipTo && element.skipTo.toString().length > 0 && Number(element.skipTo) >= 0)
{
skipAtTheEnd = Number(element.skipTo);
}
soundPanning = 0;
if (element.panning && element.panning.toString().length > 0 && Number(element.panning) >= -100 && Number(element.panning) <= 100)
{
soundPanning = Number(element.panning) / 100;
}
if (!(soundID && soundPath && soundID.length > 0 && soundPath.length > 0))
{
continue;
}
br.com.stimuli.loading.BulkLoader.getLoader("mainLoader").add(soundPath, {"id":soundID});
parsedSounds[soundID] = {"id":soundID, "url":soundPath, "volume":soundVolume, "panning":soundPanning, "loops":soundLoops, "skipFrom":skipFromTheStart, "skipTo":skipAtTheEnd};
}
tm.com.TemplateState.getInstance().sounds = parsedSounds;
}
if (mainData.pages)
{
parsedPages = new Array();
loc2 = 0;
loc3 = mainData.pages.elements();
for each (element in loc3)
{
attributesCollection = new Object();
var loc4:*;
loc4 = 0;
var loc5:*;
loc5 = element.attributes();
for each (attribute in loc5)
{
attributesCollection[attribute.name().toString()] = attribute.valueOf().toString();
}
page = {"type":element.type.toString(), "properties":attributesCollection};
if (element.images)
{
page.images = element.images;
}
loc4 = 0;
loc5 = element.images.elements();
for each (imageElement in loc5)
{
imagePath = imageElement.url.toString();
if (!(imagePath && imagePath.length > 0))
{
continue;
}
br.com.stimuli.loading.BulkLoader.getLoader("mainLoader").add(imagePath, {"id":com.adobe.crypto.MD5.hash(imagePath)});
}
if (element.texts)
{
page.texts = element.texts;
}
if (element.buttons)
{
page.buttons = element.buttons;
}
if (element.form && element.form.configuration.toString().length > 0)
{
br.com.stimuli.loading.BulkLoader.getLoader("mainLoader").add(element.form.configuration.toString(), {"id":com.adobe.crypto.MD5.hash(element.form.configuration)});
page.form = element.form;
}
parsedPages.push(page);
}
tm.com.TemplateState.getInstance().pages = parsedPages;
}
if (mainData.readMorePages)
{
parsedReadMorePages = new Array();
loc2 = 0;
loc3 = mainData.readMorePages.elements();
for each (element in loc3)
{
readMorePage = {};
if (element.images)
{
readMorePage.images = element.images;
}
loc4 = 0;
loc5 = element.images.elements();
for each (readMoreImageElement in loc5)
{
readMoreImagePath = readMoreImageElement.url.toString();
if (!(readMoreImagePath && readMoreImagePath.length > 0))
{
continue;
}
br.com.stimuli.loading.BulkLoader.getLoader("mainLoader").add(readMoreImagePath, {"id":com.adobe.crypto.MD5.hash(readMoreImagePath)});
}
if (element.texts)
{
readMorePage.texts = element.texts;
}
parsedReadMorePages.push(readMorePage);
}
tm.com.TemplateState.getInstance().readMorePages = parsedReadMorePages;
}
if (br.com.stimuli.loading.BulkLoader.getLoader("mainLoader")._itemsTotal > 0)
{
br.com.stimuli.loading.BulkLoader.getLoader("mainLoader").start();
}
else
{
_assetsPercentLoaded = 1;
_assetsLoaded = true;
}
_mainXMLLoaded = true;
}
catch (e:Error)
{
trace("Main XML Loading Error: " + undefined.message);
if (br.com.stimuli.loading.BulkLoader.getLoader("mainLoader")._itemsTotal > 0)
{
br.com.stimuli.loading.BulkLoader.getLoader("mainLoader").start();
}
else
{
_assetsPercentLoaded = 1;
_assetsLoaded = true;
}
_mainXMLLoaded = true;
return;
}
return;
}
function frame40():*
{
onApplicationResize();
return;
}
private function onGalleryXMLLoad(arg1:flash.events.Event):void
{
var element:XML;
var event:flash.events.Event;
var galleryData:XML;
var galleryObject:Object;
var imageObject:Object;
var imagesCollection:Array;
var imagesCounter:Number;
var parsedGalleryData:Object;
var subElement:XML;
var loc1:*;
galleryData = null;
parsedGalleryData = null;
imagesCounter = NaN;
element = null;
galleryObject = null;
imagesCollection = null;
subElement = null;
imageObject = null;
event = arg1;
try
{
galleryData = new XML(event.target.data);
parsedGalleryData = new Object();
imagesCounter = 0;
var loc2:*;
loc2 = 0;
var loc3:*;
loc3 = galleryData.elements();
for each (element in loc3)
{
galleryObject = {"galleryID":element.id.toString(), "name":element.name.toString()};
if (element.elements().length() > 0)
{
imagesCollection = new Array();
var loc4:*;
loc4 = 0;
var loc5:*;
loc5 = element.elements();
for each (subElement in loc5)
{
imageObject = {"image":subElement.source.toString(), "description":subElement.description.toString()};
if (imagesCounter < tm.com.TemplateConfiguration.GALLERY_IMAGES_TO_PRELOAD)
{
br.com.stimuli.loading.BulkLoader.getLoader("mainLoader").add(imageObject.image, {"id":com.adobe.crypto.MD5.hash(imageObject.image)});
imagesCounter = (imagesCounter + 1);
}
imagesCollection.push(imageObject);
}
galleryObject.images = imagesCollection;
}
parsedGalleryData[galleryObject.galleryID] = galleryObject;
}
tm.com.TemplateState.getInstance().galleries = parsedGalleryData;
_galleriesXMLLoaded = true;
}
catch (e:Error)
{
trace("Gallery XML Loading Error: " + undefined.message);
_galleriesXMLLoaded = true;
return;
}
return;
}
function frame45():*
{
stop();
return;
}
function frame2():*
{
registerPagesEngine(pagesEngine);
onApplicationResize();
return;
}
private function resize(arg1:Number, arg2:Number):void
{
if (preloader)
{
caurina.transitions.Tweener.addTween(preloader, {"x":Math.round(stage.stageWidth / 2), "y":Math.round(stage.stageHeight / 2) + 20, "time":1, "transition":"easeOutQuart"});
}
if (_pagesEngine)
{
caurina.transitions.Tweener.addTween(_pagesEngine, {"x":Math.round(arg1 / 2 - flash.system.Capabilities.screenResolutionX / 2), "y":Math.round(arg2 / 2 - flash.system.Capabilities.screenResolutionY / 2) + 25, "time":1.2, "transition":"easeOutCubic"});
_pagesEngine.resize(arg1, arg2);
}
if (line)
{
line.holder.graphics.clear();
line.holder.graphics.lineStyle(1, 3491405);
line.holder.graphics.drawRect(30, 30, arg1 - 60, arg2 - 90);
}
if (bg)
{
bg.bg.width = arg1;
}
if (bottomControls)
{
bottomControls.y = arg2 - 58;
bottomControls.copyright.x = arg1 / 2;
bottomControls.sound.x = arg1 - 30;
}
if (menuHolder)
{
menuHolder.x = Math.round(arg1 - 110);
}
return;
}
private function playBackgroundMusic():void
{
_templateBackgroundSound = new tm.com.TemplateSound("templateBackgroundMusic");
_backgroundSoundTransform = _templateBackgroundSound.soundTransform;
_backgroundSoundChannel = _templateBackgroundSound.soundChannel;
_templateBackgroundSound.play();
_templateBackgroundSound.addEventListener("soundChannelUpdated", onBackgroundSoundUpdate);
return;
}
public function registerPagesEngine(arg1:tm.template.PagesEngine):void
{
_pagesEngine = arg1;
onApplicationResize();
return;
}
private function onAssetsError(arg1:br.com.stimuli.loading.BulkErrorEvent):void
{
br.com.stimuli.loading.BulkLoader.getLoader("mainLoader").removeFailedItems();
return;
}
private function onAssetsLoaded(arg1:flash.events.Event):void
{
_assetsLoaded = true;
return;
}
private function onGetURL(arg1:tm.com.TemplateEvent):void
{
var event:tm.com.TemplateEvent;
var request:flash.net.URLRequest;
var url:String;
var window:String;
var loc1:*;
url = null;
window = null;
request = null;
event = arg1;
url = event.info[0].toString();
window = event.info[1].toString();
if (url && url.length > 0)
{
request = new flash.net.URLRequest(url);
try
{
flash.net.navigateToURL(request, window);
}
catch (e:Error)
{
};
}
return;
}
public var bottomControls:flash.display.MovieClip;
private var _galleriesXMLLoaded:Boolean=false;
public var menuHolder:flash.display.MovieClip;
public var pagesEngine:PagesEngineClip;
private var _mainXMLLoaded:Boolean=false;
public var bg:flash.display.MovieClip;
public var line:flash.display.MovieClip;
private var _assetsLoaded:Boolean=false;
private var _backgroundSoundChannel:flash.media.SoundChannel;
public var preloader:flash.display.MovieClip;
private var _templateBackgroundSound:tm.com.TemplateSound;
public var companyNameHolder:flash.display.MovieClip;
private var _assetsPercentLoaded:Number=0;
private var _pagesEngine:tm.template.PagesEngine;
private var _backgroundSoundTransform:flash.media.SoundTransform;
private var _applicationStarted:Boolean=false;
}
}
Copy link to clipboard
Copied
that looks like decompiled code. is it?
Copy link to clipboard
Copied
yes
Copy link to clipboard
Copied
then you're likely to have lots of problems debugging it. unless you're comfortable with as3, you'll need someone to fix that for you.

