Referencing Issue w/ Movie Clip

  • ryanbutler
  • Student
  • Student
  • ryanbutler
  • Posts: 86
  • Loc: Springfield, MO

Post 3+ Months Ago

I believe I solved my problem, always happens just as I post.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

then better post both the problem and solution ... for other users which may encounter your problem.
  • classified
  • Expert
  • Expert
  • User avatar
  • Posts: 540
  • Loc: Bahrain

Post 3+ Months Ago

IceCold wrote:
then better post both the problem and solution ... for other users which may encounter your problem.


I agree...
  • ryanbutler
  • Student
  • Student
  • ryanbutler
  • Posts: 86
  • Loc: Springfield, MO

Post 3+ Months Ago

Actually, I thought I had it but I don't. The problem is this: I'm making cd versions of my flash application and I'm using a software program to eliminate file path issues when linking directly to a PDF file from an XML file. So far this code (inside my FLA file):

Code: [ Select ]
_global.linkHandler=function(aURL:String):Void {
  // mail
  if (aURL.toLowerCase().indexOf("mailto:") == 0) {
   if (mdm.Application.path == undefined) {
     getURL(aURL);
   } else {
     mdm.System.exec(aURL);
   }
   return;
  }
  if (this._parent == undefined) {
   aURL = aURL.split("aa/").join("");
  }
  var basePath = mdm.Application.path;
  if (basePath == undefined) {
   getURL(aURL, "_blank");
  } else {
   var aFile = "file:///"+basePath.split("\\").join("/")+aURL;
   var iExplorer = mdm.System.Paths.programFiles+"Internet Explorer\\iexplore.exe";
   mdm.Process.create("", 0, 0, 0, 0, "", iExplorer+" "+aFile, basePath, 3, 4);
  }
}
function convertHTML(htmlString:String):String {
  return htmlString.split('href="').join('href="asfunction:linkHandler,');
}
  1. _global.linkHandler=function(aURL:String):Void {
  2.   // mail
  3.   if (aURL.toLowerCase().indexOf("mailto:") == 0) {
  4.    if (mdm.Application.path == undefined) {
  5.      getURL(aURL);
  6.    } else {
  7.      mdm.System.exec(aURL);
  8.    }
  9.    return;
  10.   }
  11.   if (this._parent == undefined) {
  12.    aURL = aURL.split("aa/").join("");
  13.   }
  14.   var basePath = mdm.Application.path;
  15.   if (basePath == undefined) {
  16.    getURL(aURL, "_blank");
  17.   } else {
  18.    var aFile = "file:///"+basePath.split("\\").join("/")+aURL;
  19.    var iExplorer = mdm.System.Paths.programFiles+"Internet Explorer\\iexplore.exe";
  20.    mdm.Process.create("", 0, 0, 0, 0, "", iExplorer+" "+aFile, basePath, 3, 4);
  21.   }
  22. }
  23. function convertHTML(htmlString:String):String {
  24.   return htmlString.split('href="').join('href="asfunction:linkHandler,');
  25. }


Takes care of launching internet explorer and converting my links to a file on the local cd partition, whatever that is for people.

Then in the button that calls the convertHTML function I have:

Code: [ Select ]

var dataFile = "aaCourse.xml";
  if (infoBtn._parent._parent != undefined) {
   dataFile = "aa/"+dataFile;
  }
  var basePath = mdm.Application.path;
  if (basePath != undefined) {
   dataFile = basePath+dataFile.split("/").join("\\");
  }

//load XML
var data_xml=new XML();
data_xml.ignoreWhite=true;
data_xml.onLoad=function(){
        aa.aaText_txt.htmlText=convertHTML(this.firstChild.firstChild.nodeValue);
        aa.aaText_txt._height=aa.aaText_txt.textHeight;
}
data_xml.load(dataFile);
  1. var dataFile = "aaCourse.xml";
  2.   if (infoBtn._parent._parent != undefined) {
  3.    dataFile = "aa/"+dataFile;
  4.   }
  5.   var basePath = mdm.Application.path;
  6.   if (basePath != undefined) {
  7.    dataFile = basePath+dataFile.split("/").join("\\");
  8.   }
  9. //load XML
  10. var data_xml=new XML();
  11. data_xml.ignoreWhite=true;
  12. data_xml.onLoad=function(){
  13.         aa.aaText_txt.htmlText=convertHTML(this.firstChild.firstChild.nodeValue);
  14.         aa.aaText_txt._height=aa.aaText_txt.textHeight;
  15. }
  16. data_xml.load(dataFile);


The function now calls (convertHTML) when I use _global in front of the linkHanlder function but when loaded through container file, the linkHandler function isn't appending on the correct sub-directory (aa) to the end of my PDF link, however it works perfectly while inside of Flash.

If that happens to make sense and anyone knows of a solution, I'd be happy to know.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 22 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.