• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 657
  • Last Modified:

Function to return shape (as3)

Hello

How would you make a function that returns an shape based on getting a image from a url then just put the image in the background(fill) of a shape(Rectangle) and return it in a function so you can use it like:
addChild(GetShapeAndImage('www.randomimage.com/myimg.png')); ?
0
JoachimPetersen
Asked:
JoachimPetersen
1 Solution
 
dgofmanCommented:
function GetShapeAndImage(url:String) {
    var loader:Loader =new Loader();
    loader.load(new URLRequest(url));
    return loader;
};
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now