I apologize in advance for posting a similar post, but this one is much more descriptive…and im desparate!
I am loading swfs to level0…and one loads from the other and vice versa…they both call the same custom class that I wrote “XMLShape.as” in the .as file I have an array of movieclips which are booths…these booths highlight when their respective exhibitor is clicked in the list…now the problem is that the movieclip array gets all screwed up when I load the second swf from the first…here is code that I am using to test this problem, and I have figured out that it is losing the reference but how?
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#000000]**function**[/COLOR] highLight[COLOR=#000000]([/COLOR]booth:[COLOR=#0000FF]Number[/COLOR][COLOR=#000000])[/COLOR]
[COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]"List Index: "[/COLOR] + booth[COLOR=#000000])[/COLOR];
[COLOR=#0000FF]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]"MainWin Booth: "[/COLOR] + booths[COLOR=#000000][[/COLOR]booth[COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000FF]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]"MiniWin Booth: "[/COLOR] + miniBooths[COLOR=#000000][[/COLOR]booth[COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000FF]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“wtf is going on?”[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]var[/COLOR] trans1:Transform = [COLOR=#000000]new[/COLOR] TransformCOLOR=#000000[/COLOR];
[COLOR=#000000]var[/COLOR] trans2:Transform = [COLOR=#000000]new[/COLOR] TransformCOLOR=#000000[/COLOR];
tempColor = trans1.[COLOR=#000080]colorTransform[/COLOR];
[COLOR=#000000]var[/COLOR] myColor:ColorTransform = [COLOR=#000000]new[/COLOR] ColorTransform[COLOR=#000000]([/COLOR][COLOR=#000080]1[/COLOR], [COLOR=#000080]1[/COLOR], [COLOR=#000080]1[/COLOR], [COLOR=#000080]1[/COLOR], [COLOR=#000080]250[/COLOR], [COLOR=#000080]200[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]75[/COLOR][COLOR=#000000])[/COLOR];
trans1.[COLOR=#000080]colorTransform[/COLOR] = trans2.[COLOR=#000080]colorTransform[/COLOR] = myColor;
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]
–trace from first swf loaded
List Index: 1
MainWin Booth: _level0.CAD_mc.zoomControl.mapContainer.2
MiniWin Booth: _level0.CAD_mc_mini.zoomControl.mapContainer.2
wtf is going on?
List Index: 2
MainWin Booth: _level0.CAD_mc.zoomControl.mapContainer.3
MiniWin Booth: _level0.CAD_mc_mini.zoomControl.mapContainer.3
wtf is going on?
List Index: 3
MainWin Booth: _level0.CAD_mc.zoomControl.mapContainer.4
MiniWin Booth: _level0.CAD_mc_mini.zoomControl.mapContainer.4
wtf is going on?
-trace from second swf loaded…
List Index: 1
MainWin Booth: _level0.CAD_mc.zoomControl.mapContainer
MiniWin Booth:
wtf is going on?
List Index: 2
MainWin Booth: _level0.CAD_mc.zoomControl.mapContainer
MiniWin Booth:
wtf is going on?
List Index: 3
MainWin Booth: _level0.CAD_mc.zoomControl.mapContainer
MiniWin Booth:
wtf is going on?
as you can see…the reference to the actual booth mc number is missing and its referencing the whole map…I cannot understand why…
one issue that I have noticed is that the first time the app is run…the booths array looks like this…
_level0.CAD_mc.zoomControl.mapContainer.1
_level0.CAD_mc.zoomControl.mapContainer.2
_level0.CAD_mc.zoomControl.mapContainer.3
.
.
.
.
_level0.CAD_mc.zoomControl.mapContainer.326
_level0.CAD_mc.zoomControl.mapContainer.327
_level0.CAD_mc.zoomControl.mapContainer.328
when you load the second swf…the array is supposed to be cleared…but it ends up looking like this…
_level0.CAD_mc.zoomControl.mapContainer
.
.
.
_level0.CAD_mc.zoomControl.mapContainer…328 times
then
_level0.CAD_mc.zoomControl.mapContainer.1
_level0.CAD_mc.zoomControl.mapContainer.2
_level0.CAD_mc.zoomControl.mapContainer.3
.
.
.
.
_level0.CAD_mc.zoomControl.mapContainer.326
_level0.CAD_mc.zoomControl.mapContainer.327
_level0.CAD_mc.zoomControl.mapContainer.328
so it seems like the array is just getting bigger…and these _level0.CAD_mc.zoomControl.mapContainer values are being added 328 times each time I load another swf from the previous one…can anyone help? I know this is f-ed up but I cannot get my head around it…