-
Twansparant
Originally Posted by whispers
I thought they were NOT supposed to load..until I rolled over anything?
Haha, no I wish No, they ARE supposed to load!
That's why it's so weird don't you agree?
Originally Posted by whispers
until you rolled over a few of them..then they disappeared?
No, when the loading off ALL the buildings is finished, the first 2 buildings in the XML file (in this example the 2 in the top left corner) simply dissappear.
You can test it by simulating download when publishing the movie.
-
Senior Member
ok..let me look again..
and whats this:
mapListener.stopLoad = function(){
if(this.loadStarted) {
this.mcl.unloadClip(this.mc);
} else {
this.stopOnStart = true;
}
}
you have code/functions not being called or used anywhere?
just trying to weed through the code..
I guess I just understand your approach here or what it is your doing..
imho..I would strip out everything.. all these tweens..extra vars..etc until you get a base load & rollover working..
I dont see anything in the code that would stop these from showing up even?
ok..I believe I have re-worked the code (my way) and can now follow along with what you want.. (if you want any tweening..etc you can add it back in later).. I also suggest you use Tweenmax for ANYTHING tween related.. its super easy, cool and way faster than anything else!!
-
Senior Member
ok.. so lets start over.. I have the XML loading..
I have your images loading in their blank/empty clips..
I have the hit clips/buttons being attached into/above those images.. so you can have rollovers..etc..
lets start from there..
I 'think' I have all images (buildings loading)..
so what do we want to do from here.. I dont see any building 'disappear'..
-
Senior Member
I dont see them disappearing at all...
rollovers work..
initial building load/placement is fine..
not sure where you need me to go from here..
here is my final (tweaked) code:
actionscript Code:
import flash.display.*; import mx.transitions.Tween; import mx.transitions.easing.*; import flash.filters.GlowFilter; Stage.scaleMode = "noScale";
var projectArray:Array = new Array();
//map code map.createEmptyMovieClip("placeholder",map.getNextHighestDepth());
var mapListener:Object = new Object(); var mapLoader:MovieClipLoader = new MovieClipLoader();
mapListener.stopOnStart = false; mapListener.loadStarted = false; mapListener.mc = map.placeholder; mapListener.mcl = mapLoader;
mapListener.stopLoad = function() { if (this.loadStarted) { this.mcl.unloadClip(this.mc); } else { this.stopOnStart = true; } }; mapListener.onLoadStart = function(target_mc:MovieClip) { if (this.stopOnStart) { this.mcl.unloadClip(target_mc); } else { this.loadStarted = true; } preloader._visible = true; }; mapListener.onLoadComplete = function(target_mc:MovieClip) { preloader._visible = false; };
mapListener.onLoadInit = function() { this.mc.forceSmoothing = true; }; //add map listener mapLoader.addListener(mapListener);
//load xml var myXML = new XML(); myXML.ignoreWhite = true; myXML.onLoad = function(success) { if (success) { //load map image map_image = myXML.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue; mapLoader.loadClip(map_image,map.placeholder);
showProjects(); } else { trace("XML not loaded"); } }; myXML.load("content/content.xml");
/* -------------------------------------------------------------------------------- PROJECT ---------------------------------------------------------------------------------*/
function showProjects() { // Get buildings node nodepath = myXML.firstChild.childNodes[1].childNodes[4].childNodes[0].childNodes[1]; //total buildings ptotal = nodepath.childNodes.length;
var pLoader:MovieClipLoader = new MovieClipLoader(); var pPreloader = new Object(); pPreloader.onLoadStart = function(target) { trace("load started......"); }; pPreloader.onLoadInit = function(target) { trace("load complete......."); var addHit = target._parent.attachMovie(target._parent._name, "hit", target._parent.getNextHighestDepth());
addHit.onRollOver = function() { trace("ID CHECK: " + this._parent.id); showTooltip(this._parent.id); }; addHit.onRollOut = function() { hideTooltip(); }; addHit.onRelease = function() { //showDetails(this._parent..id); }; }; //add listener pLoader.addListener(pPreloader);
for (i = 0; i < ptotal; i++) { //declare vars var pimage = nodepath.childNodes[i].childNodes[0].firstChild.nodeValue; var ptitle = nodepath.childNodes[i].attributes.label; var phit = nodepath.childNodes[i].childNodes[1].firstChild.nodeValue; var ptooltip = nodepath.childNodes[i].childNodes[2].firstChild.nodeValue; var pmenu = nodepath.childNodes[i].attributes.label; var pstatus = nodepath.childNodes[i].attributes.status; var prent = nodepath.childNodes[i].attributes.rent; var pmc = projects.createEmptyMovieClip(phit, projects.getNextHighestDepth()); var imageHolder = pmc.createEmptyMovieClip("imageHolder", pmc.getNextHighestDepth());
projectArray.push({pimage:pimage, ptitle:ptitle, phit:phit, ptooltip:ptooltip, pmenu:pmenu, pstatus:pstatus, prent:prent, pmc:pmc, imageHolder:imageHolder});
var targetClip = eval(projectArray[i].pmc); targetClip.id = i; pLoader.loadClip(projectArray[i].pimage,projectArray[i].imageHolder); //trace("TARGET CLIP ID: " + targetClip.id); //trace("ID CHECK OG: " + projectArray[i].pmc.id + newline); } }
/* -------------------------------------------------------------------------------- TOOLTIP ---------------------------------------------------------------------------------*/ function showTooltip(id:Number) { // Attach Tooltip if (_root._xmouse < 490) { tooltip_holder.attachMovie("tooltip_right","tooltip",tooltip_holder.getNextHighestDepth()); } else { tooltip_holder.attachMovie("tooltip_left","tooltip",tooltip_holder.getNextHighestDepth()); } //update initplacement tooltip_holder.tooltip._x = _root._xmouse; tooltip_holder.tooltip._y = (_root._ymouse) - 25; // Follow Mouse mylistener = new Object(); mylistener.onMouseMove = function() { tooltip_holder.tooltip._x = _root._xmouse; tooltip_holder.tooltip._y = (_root._ymouse) - 25; updateAfterEvent; }; Mouse.addListener(mylistener);
tooltip_holder.tooltip.info.kop.htmlText = projectArray[id].ptitle.toUpperCase();
var tooltipLoader:MovieClipLoader = new MovieClipLoader(); var tooltipListener = new Object(); tooltipLoader.addListener(tooltipListener); tooltipListener.onLoadInit = function(target) { scaleThumbs(target,100,70); }; tooltipLoader.loadClip(projectArray[id].ptooltip,tooltip_holder.tooltip.info.picholder); }
// Hide tooltip function hideTooltip() { Mouse.removeListener(mylistener); tooltip_holder.tooltip.removeMovieClip(); }
-
Twansparant
Originally Posted by whispers
I dont see them disappearing at all...
rollovers work..
initial building load/placement is fine..
not sure where you need me to go from here..
Really? You got to be kidding me... Even with your code, the first 2 buildings still dissapear!
So to be absolutely clear: the 2 buildings in the image in my previous post with the red circle around it ARE visible in your movie when you export?
I tried this on 2 different machines in Flash CS4 and they just dissapear when all the buildings are fully loaded???
-
Senior Member
although I 'see' it as one building/image.. yes whatever it is you circled in yoru pic.. is there..
was in your code.. and still is in mine.
I dont need to simulate download anything.. if it loads and is visible..there is no reason to doubt it..
simulating download speed (reduced loading).. is where you can get errors/bugs
Im on WinXP
CS3
I re-worked the code to be easier/cleaner to follow.. and still get the same results..
works for me.. from what I understand I am to be looking for.
-
Twansparant
Originally Posted by whispers
works for me.. from what I understand I am to be looking for.
I'm sorry you must think I'm crazy by now...
But this is very frustrating because in CS4 on a Mac they are just NOT there
Originally Posted by whispers
I dont need to simulate download anything.. if it loads and is visible..there is no reason to doubt it..
No I know, but when I simulate the download they DO appear for a second, so I'm positive it has nothing to do with the images
I just opened the file in CS4 on Windows XP and the same freaking problem occurs!
-
Twansparant
Okay I found the problem! It's some sort of bug/limitation in Flash CS4
I saved as CS3 and opened my file in CS3, exported and voilá: no problem whatsoever! I knew I'm not crazy
But should I move my thread then? Because in the thread prefix I can't choose CS4 (it goes up to CS3)
Very weird....
-
Senior Member
glad it worked out for you..
also you dont need all those arrays..just make one..
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|