Dynimically loaded clips - using getProperty - HOW ?

  • jbezzina
  • Newbie
  • Newbie
  • jbezzina
  • Posts: 5

Post 3+ Months Ago

I am loading a picture into _level20. How can I get the properties of this picture?

Code: [ Select ]
    this.button.onRelease = function() {
        myMCL.loadClip("gallery/photo10.jpg", 20);
        picWidth = getProperty(_target, _width);
        picHeight = getProperty(_target, _height);
        trace(picWidth);
        trace(picHeight);
    };
  1.     this.button.onRelease = function() {
  2.         myMCL.loadClip("gallery/photo10.jpg", 20);
  3.         picWidth = getProperty(_target, _width);
  4.         picHeight = getProperty(_target, _height);
  5.         trace(picWidth);
  6.         trace(picHeight);
  7.     };

What do I place instead of _target ?

Thanks :)
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

jbezzina, please remember to wrap code inside of
Code: [ Select ]

or
PHP Code: [ Select ]
 
tags, Thankyou :)
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

What version of Flash are you using ?

getProperty(instanceName, property) has pretty much been replaced with _alpha , _width , _height , ect..[b]

Instead of using getProperty() try this,
Code: [ Select ]
buttonInstanceName.onRelease = function() {
   myMCL.loadMovie("gallery/photo10.jpg"); //I've never seen loadClip() before :-/
   picWidth = myMCL._width;
   picHeight = myMCL._height
   trace(picWidth);
   trace(picHeight);
  };
  1. buttonInstanceName.onRelease = function() {
  2.    myMCL.loadMovie("gallery/photo10.jpg"); //I've never seen loadClip() before :-/
  3.    picWidth = myMCL._width;
  4.    picHeight = myMCL._height
  5.    trace(picWidth);
  6.    trace(picHeight);
  7.   };


I've never seen [b]loadClip()
before either :?
  • jbezzina
  • Newbie
  • Newbie
  • jbezzina
  • Posts: 5

Post 3+ Months Ago

Hi Patience.

Im using MX 2004. Thanks for the tip. Will try it later since I have to run.

Sorry for the code thing. This was my first posting in here. I'm sure it will not be my last.

;)
  • jbezzina
  • Newbie
  • Newbie
  • jbezzina
  • Posts: 5

Post 3+ Months Ago

Hi Patience.

I'm afraid it did not return any value. I'm getting undefined

I tried it with loadMovie and loadClip but they both failed. Here is the full code:

Code: [ Select ]
var myMCL:Object = new MovieClipLoader();

for (b=1; b<21; b++) {
    this.button.onRelease = function() {
        myMCL.loadMovie("gallery/photo10.jpg", 20);
        picWidth = myMCL._width;
        picHeight = myMCL._height;
        trace(picWidth);
        trace(picHeight);
    };
}
  1. var myMCL:Object = new MovieClipLoader();
  2. for (b=1; b<21; b++) {
  3.     this.button.onRelease = function() {
  4.         myMCL.loadMovie("gallery/photo10.jpg", 20);
  5.         picWidth = myMCL._width;
  6.         picHeight = myMCL._height;
  7.         trace(picWidth);
  8.         trace(picHeight);
  9.     };
  10. }


Any idea ?
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

jbezzina wrote:
Hi Patience.
Im using MX 2004.


In that case you better read this,
http://www.actionscript.org/tutorials/i ... ndex.shtml

MovieClipLoader is a new class for mx2004 I was unaware of (im using 6) what your looking for is in paragraph 8(they're numbered) of the above link.

Code: [ Select ]
var myMCL = new MovieClipLoader();
myMCL.onLoadInit = function (targetMC)
{
    picWidth = targetMC._width;
    picHeight = targetMC._height;
}

myMCL.loadClip("path/to/movie.swf","targetMC");
  1. var myMCL = new MovieClipLoader();
  2. myMCL.onLoadInit = function (targetMC)
  3. {
  4.     picWidth = targetMC._width;
  5.     picHeight = targetMC._height;
  6. }
  7. myMCL.loadClip("path/to/movie.swf","targetMC");
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

The content must be 100% loaded before you can modify it's properties.

In Flash MX you had to make a dynamic preloader, but in MX 2004 as joebert said, they created a MovieClipLoader() class that makes this easier for you folks (lucky bastards!... hehe)

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 14 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.