Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Components in embedded SWF problem (XMLConnector)

Status
Not open for further replies.

TimMontreal

Programmer
Nov 19, 2004
13
CA
I have a feeling there is either a simple answer to this that I'm not noticing or maybe it's just not possible.

I have one .swf that is one frame and contains various components, particularly: XMLConnector, DataSet and DataGrid. This .swf gets input from an SQL Server than displays various birthdays that you can select and view, blah blah blah... this works fine when I run it on it's own.

Here is the problem. I have a second .swf which is actually my main timeline and I would like to place the above mentioned .swf on frame 5 of this one using either a loader component or just a loadMovie function. But it doesn't work, the datagrid appears but no values are entered into it.

Does anyone have any suggestions as to what I've done wrong? I realize that XMLConnectors are supposed to be on the first frame, and it is on the first frame of it's .swf, but does it matter that it's not the on the first of the main timeline?

Any help would be greatly appreciated!
Thanks!
 
sounds like may be nothing more than a path problem if the recordset aint populating

if using loadmovie make sure you have included the name of the clip the swf is being loaded into in the path
 
from what I've been able to find online I think it probably is a path problem, but I'm not sure I understand how to approach it... when using the loadMovie I load in saw subfile.swf into my main timeline, let's call mainfile.swf.

The subfile is loading because I'm seeing the datagrid(which is a component in the subfile.swf), it's just that it's not populating, so I have the correct path of the which file to load in.

I think the error is that the XMLConnector (which is also in the file subfile.swf) has an incorrect path in it, but I'm not sure where to change that, from what I've been able to read.. I should have to incorporate the syntax "this" somewhere in the path to solve my problem, but I'm not sure where...

thanks again for any insight
 
try either posting the flas or the code...just cant tell from what you have said
 
I think the problem is timing more than addressing. I added an event listener to the dataset for it's "afterloaded" event and it seems to work fine when imported into the other movie. I also had to add a frame to the movie.

Try this and see if it solves your problem.
Your file

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
it doesn't seem to solve it completely although it helped pinpoint the problem for me.

With the new eventListener I can see that when it's imported the new eventListener is never getting triggered for me so the dataset is never completely loading. I have tried replacing the code I had with the code that you suggested and it is the same as before, it works fine on it's own but not when it's embedded. when it's embedded it never triggers the event.

I'm not sure, why but when I tried to replace my sub.fla with the one you put online I would get the error that follows this message, but when I simply took my fla and put your exact same code in there was no error, is there something else you've added that I'm not seeing?

Thanks for any help,
Tim

error message I get when I publish the sub.fla file you put online:

**Warning** Scene=Scene 1, layer=ui, frame=1:Line 11: There is no class or package with the name 'mx.data.types.Dte' found in package 'mx.data.types'.
__schema = {name: "Object", elements: [{name: "dataProvider", type: {name: "DataProvider", validation: {cls: mx.data.types.DataProvider, className: "mx.data.types.DataProvider",settings: {}}, category: "array"}}, {name: "deltaPacket", type: {name: "DeltaPacket", validation: {cls: mx.data.types.Obj, className: "mx.data.types.Obj"}, category: "complex"}}, {name: "items", type: {name: "Array", category: "array"}}, {name: "selectedIndex", type: {name: "Number", validation: {cls: mx.data.types.Num, className: "mx.data.types.Num",settings: {}}}}, {name: "tourtitle", type: {name: "String", original: false}}, {name: "tourdate", type: {name: "Date", formatter: {cls: mx.data.formatters.Dte, className: "mx.data.formatters.Dte",settings: {format: "MM/DD/YYYY"}}, validation: {cls: mx.data.types.Dte, className: "mx.data.types.Dte",settings: {}}, original: false}}], validation: {cls: mx.data.types.Obj, className: "mx.data.types.Obj"}, original: false};

**Warning** Scene=Scene 1, layer=ui, frame=1:Line 11: There is no class or package with the name 'mx.data.types.Dte' found in package 'mx.data.types'.
__schema = {name: "Object", elements: [{name: "dataProvider", type: {name: "DataProvider", validation: {cls: mx.data.types.DataProvider, className: "mx.data.types.DataProvider",settings: {}}, category: "array"}}, {name: "deltaPacket", type: {name: "DeltaPacket", validation: {cls: mx.data.types.Obj, className: "mx.data.types.Obj"}, category: "complex"}}, {name: "items", type: {name: "Array", category: "array"}}, {name: "selectedIndex", type: {name: "Number", validation: {cls: mx.data.types.Num, className: "mx.data.types.Num",settings: {}}}}, {name: "tourtitle", type: {name: "String", original: false}}, {name: "tourdate", type: {name: "Date", formatter: {cls: mx.data.formatters.Dte, className: "mx.data.formatters.Dte",settings: {format: "MM/DD/YYYY"}}, validation: {cls: mx.data.types.Dte, className: "mx.data.types.Dte",settings: {}}, original: false}}, {name: "tourlocation", type: {name: "String", original: false}}, {name: "tourvenue", type: {name: "String", original: false}}, {name: "tourtime", type: {name: "String", original: false}}, {name: "tourcontact", type: {name: "String", original: false}}, {name: "tourprice", type: {name: "String", original: false}}, {name: "touradd", type: {name: "String", original: false}}], validation: {cls: mx.data.types.Obj, className: "mx.data.types.Obj"}, original: false};

Total ActionScript Errors: 2 Reported Errors: 2
 
Hmmmm that's interesting. I didn't change any of your bindings on your controls, but it sure looks like a date validation problem.

Here is the .swf published on my machine. Try it and see if it works correctly. (load it into your parent movie instead of yours)

Click

On my end it is completing the load event (when loaded into the parent swf) and going to next frame (and showing the data) as it is supposed to. Let me know.
 
okay, it works perfectly... can you put the .fla online again and I will try again... thanks so much
 
Try it at the same link above. I didn't really change anything though. Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
it's strange, it just won't work. I have changed the fla you put online by changed the date encoding so I don't get the error when I publish anymore, so now I can publish it fine and just as before it makes a .swf that works on it's own but when I try to use it in the main.swf it stays stuck on the first frame.

I'm really at a lose as to what to do, I don't understand how the .swf that you published works and when I publish it it won't? any thoughts?
 
Just to make sure your publish settings are set to Actionscript 2 and Flash 7 right?

Wow JT that almost looked like you knew what you were doing!
 
yup.. that's right.. what is also strange is that if I publish your .fla as is I get the error I managed, but the .swf still works, only the dat field is blank...
but it acts the same as the other .swf that I published in that it works on it's own but not when I use it in the main.swf... even if I don't change anything at all from when you publish it... it's a mystery!
 
I am really at a loss as to why that would happen. It is indeed a mystery. So I guess the thing to do here is to make sure that your version works right.

In your version (the one you can publish) did you add the code exactly as it is in my version? (Frame 1 and Frame 2 actionscript?)

Wow JT that almost looked like you knew what you were doing!
 
yes, I duplicated your code exactly (just copy and paste), I have a friend that uses Flash MX Pro as well so I am going to go over there this morning to try publishing it on his computer to see if perhaps its a glitch in mine... I'll keep you posted!
 
Hallelujah!
I just download and installed the Flash MX 7.2 updater from the Macromedia website and now when I publish the movie it works! There must of been a glitch in the older version I was using!

Thank you so much for you patience with me, it's great appreciated!

Tim
 
It didn't even occur to me to ask about that! Glad it's working for you. :)

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top