Jump to content
Search Community

bensbury

Members
  • Posts

    7
  • Joined

  • Last visited

bensbury's Achievements

0

Reputation

  1. Sorry, I figured it out so I'll answer my own question if some one else has a similar question. You can add anything you like to the parameters property when creating the loader: (which I knew how to do) thumbqueue.append( new ImageLoader(url + thumbList[i], {parameters: ['smith'], x:i*51, container:menu.thumbs, width:50, height:50, hAlign:"center", vAlign :"bottom", name:imgName,alpha:1, visible:true }) ); You can access this from the Loader... as so private function onInitiate(e:LoaderEvent):void { var preloader = e.target.vars.parameters; } .... my problem was trying to access the parameters variable from a MouseEvent, but actually it was very easy: private function thumbOver(e:MouseEvent):void { var i = e.target; trace(i.loader.vars.parameters);} Just access the loader from the MouseEvent and there it is! I hope this is a decent way of doing it, and also it might save some time for someone else.
  2. Hi, There is probably a simple way to do this, but I didn't really know what to search for. Basically I want to attach some property or variable to the contentDisplay object from the imageLoader so I can grab it from the rollOver/Out etc Events. In the simplest case I am trying to pass an ID to the image loaded to it, so it can be linked to another loaded thumbnail image. I have passed Vars about using the Params variable on the Loader but I can't access this from the event.target on the Rollover as it targets the displayObject. Sorry if this isn't very clear..... but basically I would like to pass a variable to the image which I can pick up directly from a mouse Event using event.target. Is this doable?
  3. Hi Jack, What I discovered was this: If the swf being loaded is under 65kb (about) the swf fails to trip its own child load and thus loadCompleted events. This was stopping my fade in etc actions on loadCompleted. When I used other swf it worked. So I made new test swf which failed (because my test was a small object). When I boosted the file size of the swf, the loader would load as normal. The tripping point is somewhere between 65kb - 70kb in this case. I'll try to replicate it locally but it might be a CMS thing or who knows? ------- Okay... this is power weird, so I'll email you the test files and also where you can see it being screwy. Basically it happens only in FF (3.6.8) and only on the server I am using which might make it hard to test It works on a different server. One theory is that for whatever reason the server is too fast or something. On an activity graph the space between it hitting the cache and loading the file is very close. Also reducing the max-connections to 1, bomb the loader completely and it jams at 50% progress, although this could be where the swf is loaded in the queue. ----- When I emailed about this I didn't know if it was a loaderMax issue or not because the problem seems so rare. However when I loaded the swf with my own easyloader, it loaded without trouble. So unless someone can find the solution here, I am going to have to load images with loaderMax and swfs the Adobe way. ---- Update ----- So in my case this only happens on gzipped servers and on Firefox. Jack fixed it with a tweaked swfloader.as to compensate for FF silliness. While I guess it'll go into a new loaderMax version, if anyone is having such a problem, that's the answer and I can send you the fix, if you can't get it from straight from Greensock.
  4. Hi, I'll try and make a demo .fla Partly tricky as the thing is locked into the CMS. What I discovered is that the SWF is not loading.... or not calling the load complete handler. So if you check the child progress everything loads except the SWF. The SWF does load however because it appears and runs, but it doesn't trip the child complete or Load completed handlers. I think it might have something to do with how I am setting the estimated bytes or something fruity over the CMS. It is strange because it works fine in the IDE. I have cross-domain set up, but it is on the same domain. I did the allow scripts, added the security and error handlers and other security things too but it didn't change anything. I have a few things to try out after a night's sleep, but if that fails I'll try and send a demo package that does the fail. I was concerned the above code was screwy, but if not then I can investigate further.
  5. Hi, I'm bewildered by this and it is going to be tough to explain. I am loading in some images and an swf from a dynamic source. Everything works perfectly in the IDE but not when I upload it. If I remove the swf from the loading list online, everything works fine. So something in the swf is causing mischief. I have loaded it individually and with LoaderMax.parse(), so that isn't causing the problem. I can load everything in if I specify all the parameters (x,y,alpha etc) in the loader and it shows. But if I load for example, the content in with 0 alpha and then try to fade in once everything is loaded it fails. However, remove the swf and everything works. It is as if the reference to the swf doesn't have the properties and so fails. I loaded the queue and noticed when I put the swf in front of the images, the images failed to respond to alpha etc after loading. If I put the swf after the queue they would load, so would the swf but it would fail to animate. The code I am using is pretty simple, and works in Dev. This is just one version of a few different ways I have tried to handle it. My plan was to wrap the loaded content in a Movie wrapper and then just animate that. However it totally fails. Here's the code... private function loadContent() { var queue:LoaderMax = new LoaderMax({ name:"mainQueue", onChildComplete: cComplete, onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); var cnt = infoObj.count; // This object holds the CMS information // In this version I tried to set up containers first and manipulate them as wrappers while (cnt -- ) { infoObj[cnt].Media = new MovieClip(); cHolder.addChild(infoObj[cnt].Media); infoObj[cnt].Media.alpha = 0; infoObj[cnt].Media.visible = true; infoObj[cnt].Media.y = infoObj[cnt].yPos; queue.append(LoaderMax.parse(infoObj[cnt].Content, {container:this, alpha:1, visible:true, name:cnt, estimatedBytes: infoObj[cnt].ContentSize, centerRegistration:true})); } //begin loading queue.load(); } private function cComplete(e:LoaderEvent):void { // This version was a forced attempt to get the content into the MovieClip var c; var i = e.target.name; c = infoObj[i]; c.Media = LoaderMax.getContent(i); cHolder.addChild(LoaderMax.getContent(i)); } private function completeHandler(event:LoaderEvent):void { var i = infoObj.count; var c; // I don't need the loop for this, but any attempt to affect the Wrapper will fail // I've tried it going fresh for getContent(i) too and it fails. while(i--) { c = infoObj[i]; c.Media.y = c.yPos; TweenMax.to(c.Media, 2, {alpha:1, x:c.xPos}); } cHolder.x = (stage.stageWidth / 2); } This code and variations all work in the IDE. It just goes to pot when an SWF is introduced and an attempt to manipulate it happens after it has loaded. I have the added to stage listener going and tried a delay on any manipulations too but it had no effect. Something about the SWF (maybe) is jamming the movie when I try to reference it. The swf for test purposes is just a black square right now. If anyone has any ideas or has had the same problem I'd be really grateful to hear form you. Thanks, Ben.
  6. I think I have figured it out. I'll leave my code for someone else who might also have been a bit unsure: !the infoObj is my object that contains the CMS data with Content having the url. So while not in the example below you can just add the custom properties to the append bit. var queue:LoaderMax = new LoaderMax({name:"mainQueue", onChildComplete: cComplete, onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); var cnt = infoObj.count; while (cnt -- ) { queue.append(LoaderMax.parse(infoObj[cnt].Content, {name:infoObj[cnt].Title})); } //begin loading queue.load();
  7. Hi, I've a CMS set up where the client can send various Media to my Flash movie which will use LoaderMax to pull in the content. Sent with CMS data are a few details for determining position and so forth. To allow for different Media types I am intending to use LoaderMax.parse() as in the documentation. Looking at the array example, is it possible to set other LoaderMax properties like x position, width, height etc as part of the array? Or how can I give LoaderMax a name/id for each url in the array so I can pick it up by name once it is loaded and use the name to reference my other information? I searched about for LoaderMax.parse() information but couldn't find much beyond the example. Any help or direction is greatly appreciated. Thanks, Ben.
×
×
  • Create New...