XML Driven Flash

Author Message

Anaya P

Tuesday 25 May 2010 8:24:01 am

Hi

I am trying to integrate flash in a template file which is xml driven. Path to xml file is mentioned in actionscript.

I have created a class which has an attribute of type File where xml file will get uploaded in admin interface. I want that file to get uploaded at the same location everytime and by the same name. So I can specify that path in actionscript and do not need to change that everytime file gets uploaded.

Is it possible to upload file at same location and by the same name or is there any other better way to do this?

Thanks in advance for your help.

Regards

Matthieu Sévère

Tuesday 25 May 2010 8:35:15 am

Hello,

You really should use flashVars and give your file path through them in the template.

(the name of uploaded file will change for every upload)

--
eZ certified developer: http://ez.no/certification/verify/346216

Anaya P

Wednesday 26 May 2010 7:29:59 am

Thanks for your quick reply.

As you suggested I have tried to pass flashvars through html to swf file. But it is not working properly.

I am not flash expert, so may be have missed any step.

I have followed below steps -

1. created a variable of type string

2. in html passed value as a name of xml file.

In flash actionscript have below code -

function loadXML(loaded) {
if (loaded) {
_root.booth = this.firstChild.childNodes[62].childNodes[0].firstChild.nodeValue;
_root.area = this.firstChild.childNodes[62].childNodes[1].firstChild.nodeValue;
_root.price = this.firstChild.childNodes[62].childNodes[2].firstChild.nodeValue;
_root.company = this.firstChild.childNodes[62].childNodes[3].firstChild.nodeValue;
_root.website = this.firstChild.childNodes[62].childNodes[4].firstChild.nodeValue;
booth_txt.text = _root.booth;
area_txt.text = _root.area;
price_txt.text = _root.price;
company_txt.text = _root.company;
website_txt.text = _root.website;
} else {
trace(" file not loaded! " );
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(" myFlashVar " ) ;

value to myFlashVar is passed using flashvars syntax in html embed and object tag.

Can you please let me know what wrong i am doing here.

Regards

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 21:15:53
Script start
Timing: Jan 30 2025 21:15:53
Module start 'layout'
Timing: Jan 30 2025 21:15:53
Module start 'content'
Timing: Jan 30 2025 21:15:53
Module end 'content'
Timing: Jan 30 2025 21:15:53
Script end

Main resources:

Total runtime0.0298 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0076 588.0156151.1953
Module start 'layout' 0.00760.0055 739.2109220.6563
Module start 'content' 0.01310.0150 959.8672997.7734
Module end 'content' 0.02810.0017 1,957.640633.9922
Script end 0.0298  1,991.6328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00268.7471140.0002
Check MTime0.00103.4945140.0001
Mysql Total
Database connection0.00082.555910.0008
Mysqli_queries0.005919.733530.0020
Looping result0.00000.079910.0000
Template Total0.00123.910.0012
Template load0.00093.018010.0009
Template processing0.00030.901810.0003
Override
Cache load0.00051.766810.0005
General
dbfile0.00206.652480.0002
String conversion0.00000.032840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs