Monday, October 06, 2008

mx:Image limitation

I have a website I'm working on where the background is 8000 pixels wide and 800 pixels tall. I tried for hours, but I could not get the image to load. So how did I solve the problem? With a rather ugly workaround. I created a HBOX with a horizontalGap of 0 and then put two images in it each one being 4000x800. That worked perfectly. I don't have time to really dig in and figure out what's going on or what specifically the limitation is, but I do know that it has something to do with dimensions, and not file size. The reason I know this is because in my efforts to fix it, I tried making the image a really compressed lossy JPEG and even that wouldn't load (it was only 200k!). The version that's up now is about 1,200k (two 600k images) and it's running fine. I'll let you all know when it's up because this site should be pretty visually awesome... although the content is a bit questionable.

Labels: , , , ,

Monday, July 07, 2008

PureMVC: SendNotification vs. NotifyObservers

PureMVC has two ways to dispatch a Notification. A "note" for short, is like a Flex Event but that's another story. So what's the difference? The main difference is that sendNotifiaction builds the note and sends it at the same time. It's arguments are the same as Notification. notifyObservers is perfect for when you already have a notification constructed or you have a custom implementation of notification. notifyObservers(new Notification("SomeNotificationName"));

VS

sendNotification("SomeNotificationName") NotifyObservers can be called from the facade and other than the constructor argument, pretty much works the same way. sendNotification can be called from a proxy or mediator.I may have this wrong, but I don't think you can do sendNotification from a command, and I'm not sure exactly why. So if you need to dispatch an event from Command, I guess that's another use for facade.notifyObservers. You can send notifications from command, mediator, or proxy.

Labels: , , , , ,

Feed (RSS/Atom)

Contact Me

Don't put anything here: