From: AXDT <no_...@ax...> - 2010-01-11 07:51:35
|
#198: Flex DesignView Import does not work. ------------------------+--------------------------------------------------- Reporter: franz_see | Owner: asdt.org Type: defect | Status: new Priority: major | Milestone: Component: viewer | Version: AXDT 0.0.7 Resolution: | Keywords: DesignView import ------------------------+--------------------------------------------------- Comment(by franz_see): I've figured out the problem. Running {{{ importInput('<?xml version="1.0" encoding="utf-8"?> <mx:Application layout="absolute" xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Panel layout="absolute" title="boo" x="215" y="246" width="300" height="200"/> </mx:Application>'); }}} Results to a 'SyntaxError: unterminated string literal' (this error was traced by opening 'plugins/org.axdt.mxml_0.0.7.0/designview/index.html' in the browser directly). That is because the input parameter to importInput was not properly encoded into a js string. My suggestion is to simply remove the newline characters of the parameter passed to importInput: {{{ diff --git a/org.axdt.mxml/src/org/axdt/mxml/designer/MxmlDesignEditor.java b/org.axdt.mxml/src/org/axdt/mxml/designer/MxmlDesignEditor.java index 56dde66..d243040 100644 --- a/org.axdt.mxml/src/org/axdt/mxml/designer/MxmlDesignEditor.java +++ b/org.axdt.mxml/src/org/axdt/mxml/designer/MxmlDesignEditor.java @@ -171,7 +171,7 @@ public class MxmlDesignEditor extends MultiPageEditorPart implements IResourceCh IDocument doc = getDocument(); if (doc != null) { String input = doc.get(); - String command = "importInput('"+input+"');"; + String command = "importInput('"+input.replaceAll("\n|\r", "")+"');"; browser.execute(command); } } }}} -- Ticket URL: <http://axdt.org/ticket/198#comment:6> AXDT <http://axdt.org/> This is the AXDT development site. ActionScript Development Tools(ASDT) is an ActionScrip2 IDE for the Eclipse platform. Action ?? Development Tools(AXDT) is an ActionScrip3 IDE for the Eclipse platform. |