Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by vuk

  1. Hello,

    The easiest way to explain this is to give you an code example with comments that explain problem inside.

    Here it is:


    screenSound = new MP3Loader("sounds/screen.mp3", {name:"audio", autoPlay:false, repeat:0, estimatedBytes:9500});
    rotateSound = new MP3Loader("sounds/rotate-short.mp3", {name:"audio", autoPlay:false, repeat:0, estimatedBytes:9500});
    var queue:LoaderMax = new LoaderMax({name:"mainQueue", onComplete:animateBg});
    queue.append( screenSound );
    queue.append( rotateSound );
    queue.load ();
    //after a few lines of code in animateB function which is invoked by event handler in LoaderMax I use:
    //and this works fine
    //then again after few lines of code in some other function which is invoked from animateBg I again try to use
    //and nothing, sound won`t play


    So, looks like I just can`t play loaded sound more than once... what am I doing wrong?

  2. Hello,


    I have loader which content I attach to AutoFitArea and everything works fine when I`m loading *regularly created swf or plain jpg files.

    * swf with no extra object that go beyond original size of that swf.


    However, there is one BIG problem if there is such a case, if my swf has certain object that is placed somewhere outside its stage.


    Looks like AutoFitArea takes size of an object itself and then manipulate with it`s sizes to make it "Autofit".


    However, in this case, i guess, I need to provide exact size so that AutoFitArea can calculate better of how to fit that swf.

    Is there something like that, so that I can work around this problem?


    I guess that is customBoundsTarget ? If it is, then how to use it?

  3. Hello,

    yes, partly...


    But to use AutoFitArea I need to know mc size. However, I don`t know how to get it? Can you please check this code?


    var queue:LoaderMax = new LoaderMax({name:"mainQueue", onComplete:processLoad});
    queue.append(new DataLoader(adImage, {name:"swf", format:"binary"}));
    function processLoad (e:Event):void {
    	if (loadCheck == 0){
    		swf1 = new Loader();
      			corner.adHolder.ad.addChild(swf1 as DisplayObject);
    // get size
    		var rawContent:DisplayObject = swf1 as DisplayObject; //gets the image that was loaded
    		var bounds:Rectangle = rawContent.getBounds(rawContent);
    		trace("native width: " + bounds.width + ", height: " + bounds.height);
    		corner.adHolder.ad.adArea.width = bounds.width;
    		corner.adHolder.ad.adArea.height = bounds.height;
    		var area:AutoFitArea = new AutoFitArea(corner.adHolder, 0, 0, 250, 50, 0x000000);
    		area.attach(corner.adHolder.ad, {scaleMode:ScaleMode.STRETCH, hAlign:AlignMode.LEFT, vAlign:AlignMode.CENTER, crop:true});
    		area.preview = true;

  4. Hello,


    I`m using DataLoader to load swf into specific mc.

    However, I need to resize it to fit certain area (150x150), like I usually do in ImageLoader, but that isn`t working in DataLoader class.


    var queue:LoaderMax = new LoaderMax({name:"mainQueue", onComplete:processLoad});
    queue.append( loader );
    queue.append(new DataLoader(myImage, {name:"swf", format:"binary", width:150, height:150, scaleMode:"proportionalInside"}));
    function processLoad (e:Event):void {
    		trace (loadCheck);
    		swf1 = new Loader();


    I must use DataLoader, since that is the only way to cache child swf, and then to control it`s sound.

    So, is there a some other way to resize/rescale my child swf?



  5. Hi,

    I`m using ImageLoader class for image loading and processing.


    here is the code:

    var _qimage:ImageLoader = new ImageLoader(_image, {name:"photo1", estimatedBytes:2400, container:imageLoader, x:imageLoader.thBg.x, y:imageLoader.thBg.y, alpha:1, width:80, height:62, scaleMode:"proportionalOutside", onComplete:completeHandler, onError:errorHandler});


    As you can see, by using: width:80, height:62 I define size in which image should be loaded and that needs to be loaded in that size, but I also need original size info.


    My question is: Can I get original/native size of Image I`m loading.


    Thank you