Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Function to return shape (as3)

Posted on 2013-05-21
1
Medium Priority
?
607 Views
Last Modified: 2013-08-11
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
Comment
Question by:JoachimPetersen
1 Comment
 
LVL 29

Accepted Solution

by:
dgofman earned 1500 total points
ID: 39188898
function GetShapeAndImage(url:String) {
    var loader:Loader =new Loader();
    loader.load(new URLRequest(url));
    return loader;
};
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses
Course of the Month12 days, 1 hour left to enroll

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question