Externalized .xml text in SWF?
Hi
I have created a flash presentation (pretty simple), with action script that calls in the text from an XML file. This allows text edits (or translation) to occure outside of the flash environment. We simply translate the .xml file, the updated or translated text automatically populates when the .swf file is opened. This is great! However the .xml file must remain in the same file system directory as the .swf file or there will be no text when the .swf is opened. Generally this would not be a problem. But we would like to have the .swf file uploaded to the website as a standalone piece. Does anyone know how to keep the externalized text but somehow keep the .xml file as part of the .swf packedge?
Thanks
Well I understand you probably just want to somehow publish them together but you cant. What I don't understand is why can't you just upload the xml to the same folder as the swf on the server? Just have them located together anywhere and however your presenting them, have the user pull up the swf. Just link that to them. They don't have to open the xml or even see it at all. They definitely can't edit it, it's on your server. The only other way is to hardcode the xml instead of externally linking them like kglad mentioned. If your not getting the answer you want, then it just depends on how your presenting this to them. Do you have hosting and server space or are you trying to upload the swf on some random website. If you have server space, upload them together. and if you just don't want to upload two files, FTP it instead of their the hosts filemanager. Anyway, good luck
Similar Messages
-
Load external image & text into SWF
Can someone point me to a tutorial on how to create a
template that will load an external image file,.css styled text
& a .css style sheet into a .swf by using .xml?
Thank you for your time.
CKYou can use the MovieClipLoader class to load multiple images sequentially (one at a time), but you wouldn't use a 'for' type of loop...instead you would use a recursive loop, where a loading function is called after each load completion until all loading in done. This is done by utilizing a load-complete listener to trigger loading of the next image. So you start the loading process by loading one file, when that file is determined to be loaded, the listener proceses that file in whatever way you need to prepared (resizing, etc) and triggers the loading of the next file.
If you look up the MovieClipLoader.addListener method in the Flash help documents there is an example there that uses the onLoadInit event. You would be wanting to use the onLoadComplete event. -
Import external xml file in PDF using Livecycle
I require sending some values in main xml file from the external xml file during sending mail on button click. Doing so, I want to read values from external file into a hidden field or send the external xml/text file as an attachment.
1. Is there any feature in live cycle to attach multiple xml/text files in mail using button click?
2. Is there any way to read an external xml file to pre-populate a textbox using javascript?
Kindly help me to find out the solution.
Thanks in advance
Vikram KumarHi,
1) You can do this with a script. But this script works only with the Acrobat Pro not with the Adobe Reader!!
2) Sure.
You open your form.
Go to File | Form Properties | Preview | then choose your xml-file
Then you have to got to the textobject | mark this | go to "Object" | "Binding"
Here you can bind the field: $record.PRINTJOB.PMSDATA.ObjectNameXML (You have to adapt this in the path in your XML to the field in the XML)
If you make a preview you will see the value of the XML in your textfield.
You can also script the databinding. You have to go to the initalize.event and write:
this.rawValue = xfa.record.PathToYourFieldInYourXML.ObjectNameXML.value;
Hope it will helps you,
Mandy -
Bulleted Text in External XML w/CSS
I have a TexatArea component which is loading text from an
external XML file into a Flash 8 SWF. The text is being styled with
a CSS (which is working fine in every other respect on this text
(font, color, margins, etc.). I have created a custom .class in the
CSS called <bulletText> and have assigned my text the bullet
properties by taggeing those items in the XML with the
<bulletText> tag.
I am guessing one of two problems: (1) I am not using the
right code in the CSS to make text appear with "bullets" or the
TextArea component in Flash will not display CSS formatted XML?
I created the CSS in GoLive CS2 and the Inspector in GoLive
shows the bulleted example text to be correct based on my
formatting of the CSS. Am I missing something?Hi
You are calling the displayDates() at creationcomplete() of DateChooser. But at that time your xImages(xml) is null because it is not initialized and the HttpServices is not returned the result.
So initialize your xml and call displayDates() after httpservices returns the result.
Hope this helps
Regards
Rush-me -
Hello
I currently have a project where the client has requested to have the ability to update the text fields inside the project at a later date.
This is due to the nature of the content changing rather rapidly, i would like to set this up so the client can manage this them selfs.
What would the best way to do this be?
I'm thinking XML, an external XML sheet were by Captivate imports the text from this XML sheet and then displays it within the specific text fields contained within the captivate output.
This way the client would just update the external XML document(cut and paste the text in) and then the text would be dynamically updated in the published Captivate document.
any help would be amazing !
Thanks in advance
NickHi Lieve
But isn't this thread more about an end user having an ability to change text after the Captivate has been published and delivered? I could see where that might be useful if making changes then publishing to create a new output. But I'm interpreting that the situation here is that a Captivate project has been published and delivered, and some mechanism is desired that allows the recipient to modify an external XML file to influence changes in the already compiled Captivate output.
Cheers... Rick -
Testing SWF with external XML file, strange problem.
Hi!
My problem started after migration to 2.01. But I think it's
not version problem.
I have old project which uses external XML files ("
http://www.mydomain.com/myxml.xml").
When I teste project in "bin" folder it works perfect and SWF
import data from XML.
I created new Flex project and copied all scripts from old
one. And my new app can't read external XML!!! (tested in "bin"
folder):
*** Security Sandbox Violation ***
Connection to xmlURL halted - not permitted from
file:///C:/myproject/bin/myproject-debug.swf
BUT when I copy my new SWF to the old project "bin" folder
then it WORKS! Strange!
I found in Help "The Global Flash Player Trust directory" and
I checked files: "flexbuilder.cfg", "flexbuilder.fbr" there are all
my project paths (old and new).
Thanks for help!
newmanYou should your homework with Google and other search engines
better ;)
http://www.robrusher.com/1/2006/08/Flex-2-Error-with-XML.cfm -
Using external XML to load an swf
Here's the deal - I have a main SWF with lots of loaders. Can
a hyperlink in an external XML file load another external swf in
the root flash doc? I have a list of links load in main SWF from an
external XML file. From these links, I'd like to load other
external SWFs in the main flash document. I can get the XML links
to control my browser... can I get them to control what happens in
my flash doc?
Thanks!nothing in an xml file can load anything. but you can load a
string that you use in your swf indicate which target file to
load. -
Loading external XML data into XMLObject
hey all,
i've been working on a basic fl2 app that generates a list of
posts from an external XML file located on my server
(www.omedia.mobi/forum.xml) The swf file is also located there in
the same directory .(crime.swf).
The app runs fine in the emulator, both when i tried to load
the data locally on my mac, and when i load it from the server. But
when i put the swf file on my N70, it fails to load the data.
I'm banging my head against a wall trying to get this sorted.
has anyone had any similar experiences?
any help would be apprieciated...
many thanks
MattMatt–
Dumb question, are you 100% sure that your phone is making
any connection to the internet? Does your phone read a name/value
variable from an external file?
I just build a file to test this (It won't work
online—it will only work on a phone.):
http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.swf
The FLA is also up:
http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.fla
Also, you can check out:
http://www.adobe.com/devnet/devices/articles/flashlite11_rss.html
quote:
//Some of the code from the FLA:
canLoad = _capLoadData;
if (canLoad == 1) {
urlPath = "
http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.txt";
loadVariables(urlPath, _root);
} else {
connection = "client does not support loading dynamic data";
// where "connection" is the variable name of the text field
If the connection is present, then I think I know what is
wrong. Let me know. -
Adobe Captivate / External Files of integrated SWF
I have an Captivate File that contains an SWF, that loads an external XML File. The SWF works perfect / AS3 and the files are in the correct folder.
However, Captivate does not link to the relative path, that is given by the swf, but to a very strange temporary path in my documents.../local.../temp...:
Error #2044: ioError unverarbeitet. text=Error #2032: Stream-Fehler. URL: file:///C|/DOKUME%7E1/cpe/LOKALE%7E1/Temp/cp4Temp/%7ECa292/config.xml
at test_xml()
This is somewhat spectacular, since I didn't thought that captivate could top the main bug of not providing right-click opportunities on local machines without setting a trusted path (this file goes to customers...).
Whatever: I would be very thankful if someone would provide me with a solution for this bug, since I'm running towards a deadline and captivate confuses me with ridicoulous errors on problems that I would have never imagined of.Hi again
All of it boils down to security. Thanks hackers! NOT!!!
Basically, if you will be deploying on CD-ROM, you need to trick Flash into thinking it is running from a server. This is easily overcome by using a freeware application called Server2Go.
Additionally, you need to ensure that the latest patch has been applied to Captivate, as it resolves some linking issues.
The process below should work to install Server2Go on CD-ROM
Download the Server2Go software from http://www.server2go-web.de/download/download.html
Choose the Micro package
This should result in receiving a zip file named distribute_apache1.3_micro.zip
Unzip the contents of the zip file to the root of your hard drive ( C:\ )
This should create a folder named distribute_apache1.3_micro
Open this folder and delete the following files and folders inside:
Files:
splash.bmp
logo.ico
readme.txt
Folders:
dlls
dbdir
cgi-bin
Open the htdocs folder and delete all files and folders inside.
Copy all of your Captivate output files to the htdocs folder
Rename the HTML page Captivate created to index.htm
Copy the contents of the distribute_apache1.3_micro folder to the CD-ROM and test!
Hopefully this helps! Rick
Helpful and Handy Links
Captivate Wish Form/Bug Reporting Form
Adobe Certified Captivate Training
SorcerStone Blog
Captivate eBooks -
_blank link in external xml generates pop up blocker
I have links that are read into an html formatted text field
from an external xml file. My problem is that I would like the link
to load a new browser window when clicked using _blank - but that
generates pop up blocker in firefox.
I've tried passing the link to a function in flash to do the
same thing , but no luck with that.
The links all work OK (as soon as I put _self in it performs
as expected)
Does anyone know a solution to this problem
thanksyou could try using javascript to open the popup and see if
your popup blocker is less sensitive about that. you would use the
externalinterface class in flash to communicate between
actionscript and javascript. -
How to import external XML file
Hello guys:
From this demo
http://www.adobe.com/devnet/flex/quickstart/accessing_xml_data/#section2
we know how to use a intrernal XML document. I know there are
several way to load a external XML like:
<mx:HTTPService
id="loadTest"
useProxy="false"
showBusyCursor="true"
resultFormat="xml"
url="data/login.xml"
/>
What I want to know is whether I could load a XML file
directly, not use HTTPService and send. For a instance:
[Bindable]
private var login:XML = ("data/login.xml");
or something like that. And then I could use login.user or
login. pass .
Now seems it is easy to control a intrernal XML data. I want
to import a external XML file and use it like a intrernal XML.
Thanks a lotYou only have 2 choices: include the XML as part of the SWF
using <mx:XML source="filename.xml" /> or load it dynamically
using a data service such as HTTPService. -
I am just trying to get my head around Flex by building a
simple application.
What I have at the moment is index.mxml that has an
ToggleButtonBar in it and a ViewStack that lists the three menu
options in the ToggleButtonBar. Clicking each of the buttons in the
ToggleButtonBar opens a new mxml either PageOne.mxml, PageTwo.mxml
or PageThree.mxml (by wiping up and down). This all works and I
have managed to style and position the elements as I want them and
I have activated the history on the 'pages'.
What I would like to be able to do is populate the ViewStack
data from an external xml file (e.g. menu.xml) . I would also like
to populate the sub-mxml files with data from another xml file
(e.g. content.xml) where this would hold the panel's title and a
paragraph of text into something like a textarea.
I have managed to populate xml data into a datagrid on
another test application, but I can't see how this can work with
panels.
Hopefully once I have grasped the basics on how Flex
applications import data I can teach myself how to progress things
to do other things.
Thanks in advance.I tried writing a tiny bit of xml - something like this:
<xml id="test">
<root>
<menuitem>hello</menuitem>
</root>
</xml>
Then a script that creates a new button (which works). But I
have tried pulling in the data from the xml file to add to the
button like this:
myButton.label = test.root.menuitem;
But it doesn't work. If I put some text in quotes it does
display. The problem is the fact that I am not pulling in the data
from the xml.
Although this isn't the code I am using, how would this
snippet of Adobe's code be adapated to add text from an xml
document to poulate the button's label?
<?xml version="1.0"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
horizontalAlign="left">
<mx:Script>
<![CDATA[
import mx.controls.Button;
public function addButton():void {
var myButton:Button = new Button();
myButton.label = "New Button";
myHBox.addChild(myButton);
]]>
</mx:Script>
<mx:HBox id="myHBox">
<mx:Button label="Add Button" click="addButton();"/>
</mx:HBox>
</mx:Application> -
Im a beginner with Flex.
How do I connect an external xml to a DateChooser so every
time a date is picked a value/or text (different for different
dates) from the xml is passed into a textArea.
In this case I want a value of "50" to be passed to the the
textArea for every day of the week exept for saturdays surtain
months when the value is "80".
Please show with whole code since I'm rather new to this.
Thanks in advance!Hope he following sample helps !
quote:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="vertical">
<mx:XMLList id="statusData" >
<day name="Saturday" value="10" />
<day name="Sunday" value="20" />
<day name="Monday" value="30" />
<day name="Tuesday" value="40" />
<day name="Wednesday" value="50" />
<day name="Thursday" value="60" />
<day name="Friday" value="70" />
</mx:XMLList>
<mx:Script>
<![CDATA[
private var weekDayNames =
[ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday" ];
]]>
</mx:Script>
<mx:DateChooser id="dateChooser" />
<mx:TextInput id="status"
text="{statusData.(@name ==
weekDayNames[dateChooser.selectedDate.getDay()]).attribute('value').toString()}"/>
</mx:Application> -
Loading an image in an XML text file
I've gotten the DateChooser component to work very well
loading dynamic text fields with data from an external XML file.
Can I embed a jpeg into the XML text like I would with the
<img> tag in an HTML text file?
Many thanks in advance for any tips...
GeorgeI assume your XML looks something like this...
<event date='11/11/1111'>
<PerformerName>SomeInfoHere</PerformerName>
</event>
You could add the image info anywhere you want in the XML.
Perhaps an attribute of the PerformerName tag?
<PerformerName
image='myImage.jpg'>SomeInfoHere</PerformerName>
or
<PerformerName image='
http://www.myDomain.com/images/myImage.jpg'>SomeInfoHere</PerformerName>
When you parse the XML data and build your Array, then you
just need to capture the additional tag attribute. Similar to how
you got the date attribute.
Then at that point you would add it into the textField of
your info_txt.
Read this page in the docs to see how to add the image.
http://livedocs.adobe.com/flash/8/main/00001464.html -
Help Required on Reading an External XML file in flex
Hi Experts
I want some help regarding flex.
I want to read an external xml file in flex and want to show
different datas in different components
So bacically i need what is the procedure to call an external
xml file and the procedure to catch the value of the xml tags and
the option (options means ex: "id" or "type inside" "row" tag ) in
side the xml file.
Here is My xml file named "skn_organ.xml"
<?xml version="1.0" encoding="UTF-8"?>
<slide>
<r>7</r>
<c>8</c>
<row id="A01" type="g">
<organ>Skn</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="A02" type="g">
<organ>Brt</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="A03" type="g">
<organ>Spl</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="A04" type="g">
<organ>Lnode</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="A05" type="g">
<organ>Ske</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="A06" type="g">
<organ>Lun</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="A07" type="g">
<organ>Sgl</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="A08" type="g">
<organ>Liv</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B01" type="g">
<organ>Gal</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B02" type="g">
<organ>Pan</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B03" type="g">
<organ>Ton</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B04" type="g">
<organ>Eso</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B05" type="g">
<organ>Sto</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B06" type="g">
<organ>Sto</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B07" type="g">
<organ>Sbl</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B08" type="g">
<organ>Col</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C01" type="g">
<organ>Skn</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C02" type="g">
<organ>Brt</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C03" type="g">
<organ>Spl</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C04" type="g">
<organ>Lnode</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C05" type="g">
<organ>Ske</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C06" type="g">
<organ>Lun</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C07" type="g">
<organ>Sgl</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C08" type="g">
<organ>Liv</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="D01" type="g">
<organ>Gal</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="D02" type="g">
<organ>Pan</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="D03" type="g">
<organ>Ton</organ>
<link>
http://www.designgarbage.com</link>
</row>
</slide>Hi sanjivsutar,
Put your xml file under folder "assets", the application demo
is as following
====================================================================
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
initialize="init()">
<mx:Script>
<![CDATA[
private var mainXML:XML;
private var loader:URLLoader;
private function init():void {
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete);
loader.load(new URLRequest('assets/skn_organ.xml'));
private function onComplete(evt:Event):void {
mainXML = new XML(loader.data)
out.text += "xml loaded, using E4X syntax: \n\n";
out.text += "Row 1: "+mainXML.row[0]+"\n"
out.text += "Row 6: organ = "+mainXML.row[5].organ+"\n"
out.text += "Row(id='D02'): link =
"+mainXML.row.(@id=="D02").link+"\n"
]]>
</mx:Script>
<mx:TextArea id="out" width="400" height="300"/>
</mx:Application>
======================================================================
Jeffrey
Maybe you are looking for
-
Pavilion dv6-3227cl entertainment notebook powers on but only has a black screen
An HP Pavilion DV6-3227cl Entertainment Notebook, that is approximately 2 years old and is running Windows 7 Home Premium, AMD Vision Premium, will power on but not boot up. The fan runs and the "caps lock" light flashes once approximately every 4 s
-
Pictures in iPhoto not displaying correctly on iPhone, iPod or AppleTV
+The iPhoto 08 Library with over 13000 photos and over 400 events.+ After uploading 120+ photos from two camera's I was doing some editing for example rotating cropping etc when the application crashed. On restart some of the thumbnails were corrupte
-
System.log filling with error messages
After SL update my system.log if filling with error messages. Does any process delete the system.log periodically? What's causing this error? Getting thousands of them. 9/30/09 12:08:13 PM [0x0-0x12012].com.nowsoftware.nowxagent[181] at now.swing.NPr
-
Hi, version: Sun One Portal Server 6.0 Is there any way to catch the event from search engine Robot whenever a new RD is generated? Also how to retrieve the details of that RD? Any help will be appreciated. --Anu.
-
ATA drive won't boot alone-gray spinning startup screen. But will w/others
I'm troubleshooting a friends G4-PCI. And i can't get past a certain problem with the hard drives. The hard drive (a 2003 80gb maxtor) doesn't want to boot. But it will boot 10.4.11 if something else is in as well. So alone, i get only a flashing que