Archive for February, 2010

0

QueueLoader 3.1.8 CSS Example


I had someone come to me with some issues using the CSS item in QueueLoader. We went back and forth and I had forgotten that QueueLoader parses the stylesheet from the loader data internally. OK great, but still couldn't get the text to style. I've actually had problems with textfields and css in general in the past. So I did a little troubleshooting and was able to get it working fine. Seems the issue was making sure you set the textfield's css property BEFORE adding any html text to it. This sort of seems obvious in hindsight, but it's not one of those immediately obvious things when your scanning over code and/or tracking the flow of your functions. So yeah, do that first :)

Here's some slightly updated CSS code:

// CSS Example
 
import com.hydrotik.queueloader.QueueLoader;
import com.hydrotik.queueloader.QueueLoaderEvent;
import com.hydrotik.queueloader.QueueLoaderConst;
 
var _oLoader:QueueLoader = new QueueLoader();
 
var tf:TextField = this.getChildByName("css_text") as TextField;
 
var css:StyleSheet;
 
_oLoader.addItem("../includes/admin/test.css", null, {title:"CSS"});
 
_oLoader.addEventListener(QueueLoaderEvent.ITEM_COMPLETE, onItemComplete,false, 0, true);
_oLoader.addEventListener(QueueLoaderEvent.QUEUE_PROGRESS, onQueueProgress, false, 0, true);
_oLoader.addEventListener(QueueLoaderEvent.QUEUE_COMPLETE, onQueueComplete,false, 0, true);
 
_oLoader.execute();
 
function onQueueProgress(event:QueueLoaderEvent):void {
	trace("\t>>onQueueProgress: "+event.queuepercentage);
}
 
function onItemComplete(event:QueueLoaderEvent):void {
	trace("\t>> "+event.type, "item title: "+event.title);
	if (event.fileType == QueueLoaderConst.FILE_CSS) {
		trace("\t\tCSS: "+event.content.styleNames);
		css = event.content;
	}
}
 
function onQueueComplete(event:QueueLoaderEvent):void {
	trace("** "+event.type);
 
	// MAKE SURE YOU STYLE THE FIELD FIRST BEFORE SETTING THE HTML TEXT!!
	tf.styleSheet = css;
	tf.htmlText = "<p>This is a Test <a href='http://www.test.com'> More Text</a></p>";
}

This person also suggested that I provide detailed guides for people and a website to promote QL. There are plenty of examples within this blog as well as a place on github to keep track of QueueLoader and (hopefully) promote it. Github is also the most authoritative source on QueueLoader. It even has a logo! That said, his comments do bring up a couple of points. The first is that between the code snippets and the examples on the blog, as well as the examples.fla file in the slighty older zip file, it might be a bit confusing on how to get set up. If you download the older example files, you can then get the latest version of QL and overwrite it/update it by placing it in the proper package. The only thing that has changed significantly is the QueueLoaderConst file. If you are checking for specific item type, then you would need to change the class i.e. QueueLoader.FILE_CSS to QueueLoaderConst.FILE_CSS. This was done to improve performance. Also be sure to include the import to QueueLoaderConst.

Said person (I swear I'm not picking you:) also suggested that QL is geared towards more hard core actionscripters which isn't really the case. I know it's a jump getting into some external library based utilities, but I think (and hope) QL is set up to be almost as easy as using a core loader class and is easier to use then other options out there. I'm thinking the frustration comes from the disjointed hosting locations/examples and putting the information in the users hands. On the flip side however, there are plenty of recent links to github and I encourage you to check out the wiki as all the examples are there. Also do a search on the blog, there are a ton of posts on QL and many of the examples are still close enough to the current structure, they should get the idea across. If something is out of date on github let me know, or feel free to fork it!

Lastly, I know the documentation can be improved, the files could be retroactively updated, etc. But keep in mind that I don't get paid for this, I very rarely get a donation (I'm actually surprised when i do get one;), I've never gotten a job from QL, and for quite some time I have had no help with QL. I really, really enjoy working on QL and Flash in general and I'm certainly not complaining. Most importantly, I also would hate to discourage people from coming to me with issues or needing help. Just wanted to get this off my chest:)

bottega veneta deep coffee pocket bag deep weight loss pills bingo and game casino gambling online virtual how to win at slots versace deep coffee venus bag women does viagra work online bingo uk discount drugstore where to get viagra or cialis diazepam cheap without rx bingo and slots does cialis really work bingo gaming chanel yellow shoulder bag bingo for cash slot machine buy meds online without presciption lancel pearl premier flirt prada white shoulder bag prescriptions pain killers without a prescription viagra product information cialis generic levitra viagra cialis male enhancement online gambling offers manolo blahnik beige hangisi valium indications anya hindmarch beige hobo how does diazepam work who has the cheapest cialis price for tramadol levitra website price for generic viagra top anti depressants pharmacy zolpidem marc jacobs antique gold keylock messenger bag pill for acne casino gambling buy carisoprodol cheap create poker website zyban tablet jimmy choo purple wells shoes valtrex medication counseling for erectile dysfunction hey bingo louis vuitton patent beige sandals louis vuitton monogram idylle pink tote power bingo slot games gucci black evening bag xanax fedex oral jelly viagra new casino slots discount erectile dysfunction medication christian louboutin white ambrosina pumps poker machine games buy no phentermine prescription high stakes poker buy tory burch golden reva ballerina flats casino locations roulette casinos play online casinos bingo and slots viagra effect on women louis vuitton damier graphite keepall bandouliere marc jacobs royal blue keylock shoulder bag play roulette online casino mania online buy compazine buy gucci black trainers online casinos en internet how to win slots christian louboutin blush barcelona sandals prescription diet drugs us only mobile casino games natural clomid buy overseas viagra online casino canada online xanax fedex norvasc generic erectile dysfunction products zoloft canada uk viagra supplier casino bonus tory burch deep blue tory logo rain boots poker for money prescription drugs online adipex no prescription needed pharmacies geniune cialis no prescription ambien dosing how do muscle relaxants work valentino beige snakeskin clutch what is tadalafil ativan dosages sales viagra ysl white muse bag cialis to buy online gambling strategy cheapest phentermine pills christian dior biege medium saddle handbag alprazolam brand cheap viagra new zealand low cost adipex bally patent patent red jana tote ambien pharmacy manolo blahnik bow booties what is viagra used for dosage viagra new diet pill fda approved play slots online now cialis best price las vegas bingo cialis generic tabs versace purple venita bow satchel chloe patent purple cyndi tote fendi apricot snake peekaboo handbag discount lipitor prescription ambien ambien 10mg poker us levitra free samples do meridia phentermine work the same order celine black shoulder bag louis vuitton patent black sandals over the counter medication cheap 37 5 phentermine safe effective diet pills loewe white handbag dolce gabbana black trainers buying phentermine alprazolam generic for xanax ativan 2mg prada beige fairy l bag generic cialis canadian diet phentermine viagra online cheap europe cialis platinum play bingo levitra info prescription drugs migraines levitra alternative phentermine ingredient how does cialis work louis vuitton damier azure canvas galliera gm order amoxicillin new arthritis and psoriasis drug lipitor online pharmacy professional blackjack how does cialis ultram ingredients