?
Solved

Updating url of text in .fla

Posted on 2011-10-18
15
Medium Priority
?
362 Views
Last Modified: 2015-01-29
Hi Experts,

In my attached bottomleftpanel.fla file there is a link called "Visit Company"

I wanted to update this link.

This .fla file is not attached to any .as files but I can see one BottomLeftPanel.as file lies at path
com.saatchi.sitetemplate.model.BottomLeftPanel

when I am attaching this file as .as files with this .fla file then I am getting the error saying URL not found at the time of loading the swf file

Can we link text "Visit Company" in .fla file as well.

Please see both .as file and .fla file

Please comment

Many Thanks bottomleftpanel.fla
package com.saatchi.sitetemplate.m<wbr ></wbr>odel {
	import flash.display.Loader;
	import flash.display.LoaderInfo;
	import flash.display.MovieClip;
	import flash.display.StageDisplay<wbr ></wbr>State;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.net.URLRequest;
	import flash.text.TextField;

	import com.saatchi.sitetemplate.c<wbr ></wbr>ontroller.<wbr ></wbr>config.Con<wbr ></wbr>figuration<wbr ></wbr>2;
	import com.saatchi.sitetemplate.c<wbr ></wbr>ontroller.<wbr ></wbr>config.Set<wbr ></wbr>tings;
	import com.saatchi.sitetemplate.c<wbr ></wbr>ontroller.<wbr ></wbr>config.Sit<wbr ></wbr>eConstants<wbr ></wbr>2;
	import com.saatchi.sitetemplate.c<wbr ></wbr>ontroller.<wbr ></wbr>config.Omn<wbr ></wbr>itureTrack<wbr ></wbr>ingManager<wbr ></wbr>;
	import com.saatchi.sitetemplate.c<wbr ></wbr>ontroller.<wbr ></wbr>text.TextU<wbr ></wbr>til;
	import com.saatchi.sitetemplate.c<wbr ></wbr>ontroller.<wbr ></wbr>text.XMLTe<wbr ></wbr>xtManager;<wbr ></wbr>
	import com.saatchi.sitetemplate.e<wbr ></wbr>vent.SiteE<wbr ></wbr>vent;
	import com.saatchi.sitetemplate.c<wbr ></wbr>ontroller.<wbr ></wbr>config.Ext<wbr ></wbr>ernalLinkM<wbr ></wbr>anager;

	import gs.TweenLite;
	
	public class BottomLeftPanel extends MovieClip {
		private var _loader:Loader = new Loader();
		private var _privacyBtn:MovieClip;
		private var _compTermsBtn:MovieClip;
		private var _companyBtn:MovieClip;
		private var _termsBtn:MovieClip;
		private var _copyBtn:MovieClip;
		private var _panel:MovieClip;
		private var _bonusCounter:TextField;
		
		public function BottomLeftPanel() {
			//_journeytype = SiteConstants.JOURNEY_TYPE<wbr ></wbr>_EK;
			//_globalvolume = 1;
			this.addEventListener(Even<wbr ></wbr>t.ADDED_TO<wbr ></wbr>_STAGE, onAddToStage);
			this.addEventListener(Even<wbr ></wbr>t.REMOVED_<wbr ></wbr>FROM_STAGE<wbr ></wbr>, onRemoveToStage);
		}

		// load external bottom panel clip when this class is added onto stage
		private function onAddToStage(e:Event):void<wbr ></wbr> {
			_loader.load(new URLRequest("swf/bottomleft<wbr ></wbr>panel.swf"<wbr ></wbr>));
			_loader.contentLoaderInfo.<wbr ></wbr>addEventLi<wbr ></wbr>stener(Eve<wbr ></wbr>nt.COMPLET<wbr ></wbr>E, showPanel);
			Settings.getInstance().add<wbr ></wbr>EventListe<wbr ></wbr>ner(SiteEv<wbr ></wbr>ent.LANGUA<wbr ></wbr>GE_UPDATE,<wbr ></wbr> updateLanguageHandler);
			Settings.getInstance().add<wbr ></wbr>EventListe<wbr ></wbr>ner(SiteEv<wbr ></wbr>ent.JOURNE<wbr ></wbr>Y_TYPE_UPD<wbr ></wbr>ATE, updateJourneyTypeHandler);<wbr ></wbr>
		}

		// delete loader and child clip when this clip is unloaded
		private function onRemoveToStage(e:Event):v<wbr ></wbr>oid {
			Settings.getInstance().rem<wbr ></wbr>oveEventLi<wbr ></wbr>stener(Sit<wbr ></wbr>eEvent.LAN<wbr ></wbr>GUAGE_UPDA<wbr ></wbr>TE, updateLanguageHandler);
			this.removeChild(_panel);
			_loader = null;
			delete this;
		}

		// display preloader after preloader clip is loaded
		private function showPanel(evt:Event):void {
			_panel = getContent();
			addChild(_panel);

			setButtons();
		}

		// set up STF, Subscribe and Download buttons
		private function setButtons():void { 
			_privacyBtn = _panel.privacyBtn;
			_privacyBtn.buttonMode = true;
			_privacyBtn.mouseChildren = false;
			_privacyBtn.addEventListen<wbr ></wbr>er(MouseEv<wbr ></wbr>ent.ROLL_O<wbr ></wbr>VER, onBtnRollover);
			_privacyBtn.addEventListen<wbr ></wbr>er(MouseEv<wbr ></wbr>ent.ROLL_O<wbr ></wbr>UT, onBtnRollout);
			_privacyBtn.addEventListen<wbr ></wbr>er(MouseEv<wbr ></wbr>ent.CLICK,<wbr ></wbr> onBtnClick);
			
			_compTermsBtn = _panel.compTermsBtn;
			_compTermsBtn.buttonMode = true;
			_compTermsBtn.mouseChildre<wbr ></wbr>n = false;
			_compTermsBtn.addEventList<wbr ></wbr>ener(Mouse<wbr ></wbr>Event.ROLL<wbr ></wbr>_OVER, onBtnRollover);
			_compTermsBtn.addEventList<wbr ></wbr>ener(Mouse<wbr ></wbr>Event.ROLL<wbr ></wbr>_OUT, onBtnRollout);
			_compTermsBtn.addEventList<wbr ></wbr>ener(Mouse<wbr ></wbr>Event.CLIC<wbr ></wbr>K, onBtnClick);
			
			_companyBtn = _panel.companyBtn;
			_companyBtn.buttonMode = true;
			_companyBtn.mouseChildren<wbr ></wbr> = false;
			_companyBtn.addEventListe<wbr ></wbr>ner(MouseE<wbr ></wbr>vent.ROLL_<wbr ></wbr>OVER, onBtnRollover);
			_companyBtn.addEventListe<wbr ></wbr>ner(MouseE<wbr ></wbr>vent.ROLL_<wbr ></wbr>OUT, onBtnRollout);
			_companyBtn.addEventListe<wbr ></wbr>ner(MouseE<wbr ></wbr>vent.CLICK<wbr ></wbr>, onBtnClick);
			
			_termsBtn = _panel.termsBtn;
			_termsBtn.buttonMode = true;
			_termsBtn.mouseChildren = false;
			_termsBtn.addEventListener<wbr ></wbr>(MouseEven<wbr ></wbr>t.ROLL_OVE<wbr ></wbr>R, onBtnRollover);
			_termsBtn.addEventListener<wbr ></wbr>(MouseEven<wbr ></wbr>t.ROLL_OUT<wbr ></wbr>, onBtnRollout);
			_termsBtn.addEventListener<wbr ></wbr>(MouseEven<wbr ></wbr>t.CLICK, onBtnClick);
			
			_copyBtn = _panel.copyBtn;
			_copyBtn.buttonMode = true;
			_copyBtn.mouseChildren = false;
			_copyBtn.addEventListener(<wbr ></wbr>MouseEvent<wbr ></wbr>.ROLL_OVER<wbr ></wbr>, onBtnRollover);
			_copyBtn.addEventListener(<wbr ></wbr>MouseEvent<wbr ></wbr>.ROLL_OUT,<wbr ></wbr> onBtnRollout);
			_copyBtn.addEventListener(<wbr ></wbr>MouseEvent<wbr ></wbr>.CLICK, onBtnClick);
			
			_bonusCounter = _panel.bonusCounter;
			
			//_orig_y = _replayBtn.y;
		}

		// return the movieclip object of external bottom panel clip 
		public function getContent():MovieClip {
			return (MovieClip)(_loader.conten<wbr ></wbr>t);
		}
		
		// fade in effect
		public function fadeIn():void {
			getContent().alpha = 0;
			TweenLite.to(getContent(),<wbr ></wbr> SiteConstants2.FADE_STEPS / 10, { alpha:1 } );
		}
		
		// fade out effect
		public function fadeOut():void {
			getContent().alpha = 1;
			TweenLite.to(getContent(),<wbr ></wbr> SiteConstants2.FADE_STEPS/<wbr ></wbr>10, {alpha:0});
		}
		
		// update bonus counter
		public function updateBonus(bonuspoint:Str<wbr ></wbr>ing):void {
			_bonusCounter.text = "Total entries gained: " + bonuspoint;
			Settings.getInstance().dis<wbr ></wbr>patchEvent<wbr ></wbr>(new SiteEvent(SiteEvent.SHOW_B<wbr ></wbr>ONUS, true, true, { bonus: bonuspoint } ));
			trace("BottomLeftPanel: updateBonus()  counterText=" + _bonusCounter.text);
		}
		
		// Event Handlers
		//////////////////////////<wbr ></wbr>//////////<wbr ></wbr>//////////<wbr ></wbr>//////////<wbr ></wbr>//////////<wbr ></wbr>///////
		
		// button mouse rollover handler
		private function onBtnRollover(evt:Event):v<wbr ></wbr>oid {
			//evt.target.icon.play();
			//TweenLite.to(evt.target,<wbr ></wbr> 0.6, {y:-10});
			TweenLite.to(evt.target, 0.5, {tint:0xc49470});
		}

		// button mouse rollout handler
		private function onBtnRollout(evt:Event):vo<wbr ></wbr>id {
			TweenLite.to(evt.target, 0.5, {tint:0x000000});
			//TweenLite.to(evt.target,<wbr ></wbr> 0.6, {y:_orig_y});
		}
		
		// language update event handler
		private function updateLanguageHandler(evt:<wbr ></wbr>Event):voi<wbr ></wbr>d {
			trace("BottomPanel(): update language event detected");
			if (getContent() != null) 
				TextUtil.updateLanguage(ge<wbr ></wbr>tContent()<wbr ></wbr>);
		}
		
		// journey type update handler
		private function updateJourneyTypeHandler(e<wbr ></wbr>vt:SiteEve<wbr ></wbr>nt):void {
			//_journeytype = evt.params.type;
		}
		
		// button mouse click handler
		private function onBtnClick(evt:Event):void<wbr ></wbr> {
			switch (evt.target) {
				case _privacyBtn:
					OmnitureTrackingManager.tr<wbr ></wbr>ackExit("E<wbr ></wbr>xit site", "to privay policy page", "Exit to privacy policy from the bottom nav", "e");
					ExternalLinkManager.gotoUR<wbr ></wbr>L(Settings<wbr ></wbr>.getInstan<wbr ></wbr>ce().SiteU<wbr ></wbr>RL + "privacy.html");
					break;
				case _compTermsBtn:
					OmnitureTrackingManager.tr<wbr ></wbr>ackExit("E<wbr ></wbr>xit site", "to competition terms and condition page", "Exit to competition terms and condition from bottom nav", "e");
					ExternalLinkManager.gotoUR<wbr ></wbr>L(Settings<wbr ></wbr>.getInstan<wbr ></wbr>ce().SiteU<wbr ></wbr>RL + "compterms.html");
					break;
				case _companyBtn:
					OmnitureTrackingManager.tr<wbr ></wbr>ackExit("E<wbr ></wbr>xit site", "to company Website", "Exit to company Website from bottom nav", "e");
					ExternalLinkManager.gotoUR<wbr ></wbr>L(Settings<wbr ></wbr>.getInstan<wbr ></wbr>ce().SiteU<wbr ></wbr>RL + "compterms.html");
					//ExternalLinkManager.goto<wbr ></wbr>URL("http:<wbr ></wbr>//www.emir<wbr ></wbr>ates.com/u<wbr ></wbr>s/english/<wbr ></wbr>");
					break;
				case _termsBtn:
					OmnitureTrackingManager.tr<wbr ></wbr>ackExit("E<wbr ></wbr>xit site", "to terms of use page", "Exit to terms of use from bottom nav", "e");
					ExternalLinkManager.gotoUR<wbr ></wbr>L(Settings<wbr ></wbr>.getInstan<wbr ></wbr>ce().SiteU<wbr ></wbr>RL + "terms.html");
					break;
				case _copyBtn:
					OmnitureTrackingManager.tr<wbr ></wbr>ackExit("E<wbr ></wbr>xit site", "to copyright page", "Exit to copyright from bottom nav", "e");
					ExternalLinkManager.gotoUR<wbr ></wbr>L(Settings<wbr ></wbr>.getInstan<wbr ></wbr>ce().SiteU<wbr ></wbr>RL + "copyright.html");
					break;

				default:
					break;
			}
		}
	}
}

Open in new window

bottomleftpanel.swf
0
Comment
Question by:tia_kamakshi
  • 8
  • 5
  • 2
15 Comments
 
LVL 39

Expert Comment

by:blue-genie
ID: 36987595
I'm making an assumption here ...

ExternalLinkManager.gotoURL(Settings.getInstance().SiteURL + "compterms.html");

this is probably getting the location of the actual file and then appending "compterms.html" to it.
so the easiest thing to do would to trace

trace(Settings.getInstance().SiteURL);
and see that that returns.

it might be something as simple as a missing "/" as in + "/compterms.html");

if not can you upload the ExternalLinkManager.as file.
0
 
LVL 29

Expert Comment

by:dgofman
ID: 36987774
"when I am attaching this file as .as files with this .fla file then I am getting the error saying URL not found at the time of loading the swf file"

On EE website or on your domain. If you are uploading FLA to the webhost it is totally wrong. You must generate SWF and upload to your web hosting.

For pointing to some link during debugging you may need to include a full URL to your links

For example:

ExternalLinkManager.gotoURL("http://www.company.com/us/english/sitetools/privacy_policy.aspx");

ExternalLinkManager.gotoURL("http://www.company.com/us/english/sitetools/terms_and_conditions.aspx");
0
 

Author Comment

by:tia_kamakshi
ID: 36987784
Sorry I commented this line
      //ExternalLinkManager.gotoURL("http://www.company.com/us/english/");
      and written
      ExternalLinkManager.gotoURL(Settings.getInstance().SiteURL + "compterms.html");
      
      there to check if I a getting error because of updating my url
      
      actually it is
      ExternalLinkManager.gotoURL("http://www.company.com/us/english/index.aspx");

from below case

case _companyBtn:
      OmnitureTrackingManager.trackExit("Exit site", "to company Website", "Exit to company Website from bottom nav", "e");
      ExternalLinkManager.gotoURL(Settings.getInstance().SiteURL + "compterms.html");
      //ExternalLinkManager.gotoURL("http://www.company.com/us/english/");
break;


When I am attaching .as file code with this .fla file. I am getting error url does not exists after method onAddToStage is finished

// load external bottom panel clip when this class is added onto stage
            private function onAddToStage(e:Event):void {
                  _loader.load(new URLRequest("swf/bottomleftpanel.swf"));
                  _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, showPanel);
                  Settings.getInstance().addEventListener(SiteEvent.LANGUAGE_UPDATE, updateLanguageHandler);
                  Settings.getInstance().addEventListener(SiteEvent.JOURNEY_TYPE_UPDATE, updateJourneyTypeHandler);
            }


Please suggest also please find code for .as file ExternalLinkManager

Thanks for all your help
package com.saatchi.sitetemplate.controller.config {
    import flash.display.Sprite;
    import flash.net.navigateToURL;
    import flash.net.URLRequest;
	import flash.external.ExternalInterface;
	
	dynamic public class ExternalLinkManager extends Sprite {
	
		public function ExternalLinkManager() {
			
		}
		
		public static function gotoURL(url:String, target:String="_blank"):void {
			if (target=="_blank") {
				ExternalInterface.call("openwindow",url);
			} else {
				navigateToURL(new URLRequest(url), target);			
			}
		}
		
	}
}

Open in new window

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 29

Expert Comment

by:dgofman
ID: 36987940
Why are you using HTML file extention if all your pages using ASPX?
0
 

Author Comment

by:tia_kamakshi
ID: 36988020
Some of the links is html only and only one link is aspx link, which is external link
0
 
LVL 29

Expert Comment

by:dgofman
ID: 36988061
Is your links on public domain can I ping. I would like to compare an URL with Settings.getInstance().SiteURL
0
 

Author Comment

by:tia_kamakshi
ID: 36988091
0
 

Author Comment

by:tia_kamakshi
ID: 36988102
See very bottom of the site
0
 
LVL 29

Expert Comment

by:dgofman
ID: 36988208
Funny, I can see all your links are working, BUT you have a serious problem in some SWF file

For reproduce download Flash Player debuuger version

http://www.adobe.com/support/flashplayer/downloads.html


TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at com.saatchi.sitetemplate.controller.audios::XMLAudioManager/getAudioByPage()
      at com.saatchi.sitetemplate.controller.audios::AudioLoader/loadByPage()
      at com.saatchi.sitetemplate::Main/loadAudio()
      at com.saatchi.sitetemplate::Main/onSettingsInit()
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at com.saatchi.sitetemplate.controller.config::Settings/dispatchEvent()
      at com.saatchi.sitetemplate.controller.config::Settings/onXMLDataLoaded()
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at flash.net::URLLoader/onComplete()
0
 

Author Comment

by:tia_kamakshi
ID: 36988319
yes, you are right there are issues. We will take these issues latter.

Currently just trying to fix minor changes
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 36988690
let me see if i understand

currently the code (as in your live site) is

 ExternalLinkManager.gotoURL("http://www.company.com/us/english/index.aspx");

and you want to change it to


 ExternalLinkManager.gotoURL("http://www.company.com/au/english/index.aspx");

but the latter does not work?
you're testing this on your live server?
0
 

Author Comment

by:tia_kamakshi
ID: 36990138
Currently on the live site url is http://www.company.com/au/english/index.aspx and wanted to update
("http://www.company.com/us/english/index.aspx

I have only changed the url in my above .cs file, which is required.

As mentioned above

When I am attaching .as file code with this .fla file. I am getting error url does not exists after method onAddToStage is finished

// load external bottom panel clip when this class is added onto stage
            private function onAddToStage(e:Event):void {
                  _loader.load(new URLRequest("swf/bottomleftpanel.swf"));
                  _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, showPanel);
                  Settings.getInstance().addEventListener(SiteEvent.LANGUAGE_UPDATE, updateLanguageHandler);
                  Settings.getInstance().addEventListener(SiteEvent.JOURNEY_TYPE_UPDATE, updateJourneyTypeHandler);
            }

if I am not attaching my code to .as file and publishing the swf file , I can see still link is
http://www.company.com/au/english/index.aspx");
 
looks link is in .fla file only in some frame.

If I need to attach .as code with it. it is giving me error when running the swf by double clicking it.

Please suggest
0
 

Author Comment

by:tia_kamakshi
ID: 36993247
Any help on this.

Can we make link on text on fla file onlly without action script. I mean from any link icon or wizard

Please help me on this

Many Thanks
0
 
LVL 29

Accepted Solution

by:
dgofman earned 2000 total points
ID: 36994186
you can built an URL using ActionScript

textField.htmlText = "<a href='http://www.company.com/au/english/index.aspx'>Go to English</a>";
0
 

Author Comment

by:tia_kamakshi
ID: 37004521
Hi,

When I am updating the path of the URL in .as file to
ExternalLinkManager.gotoURL("http://www.company.com/us/english/index.aspx");

com.saatchi.sitetemplate.model.BottomLeftPanel

and attaching .as file with .fla file

After publishing, when I put this .swf file to the website, then I am not able to see all my links in present in .swf file

so, all links disappered.

But when running the .swf file in test movie mode, I can see all links text without any lnks

Just strugging to fix this link

Please suggest

Many Thanks for your help and time
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question