(SOLVED!... for the most part) Can I load an external image in my custom class?
Hello!
I started working a lot with the Classes, but I'm still reletively new to them. I wrote a class "creature" (which extends Sprite), and I have everything works well... except when it comes to the display of the image of the creature.
In previous programs, I was able to load external images using the Loader class. However, this is possible on the main timeline in Flash, right? Like this:
var imgLoader:Loader = new Loader();
imgLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, done);
imgLoader.load (new URLRequest ("001.png"));
function done(evt:Event):void {}
addChild (Bitmap (imgLoader.content));
}
Ideally, I want to do is just have a function within my class. The function must contain the addChild statement, so I might just do:
var MyCreature:creature = new creature();
MyCreature.loadImage ();
However, I'd be just as happy if I could just load the Bitmap and return it to the class. Then I could addChild myself in the main timeline:
var MyCreature:creature = new creature();
addChild (MyCreature.getBitmap ());
I tried to put the Loader code in a function within the class of creature, however it does not work. She didn't return errors, but it also doesn't display anything, despite the fact that it containing the addChild statement. Using the command path, it looks like within the service implementation, but addChild does nothing. Am I missing something? Is there a better way?
Here is the function in my class of creature:
public void loadImage() {}
var imgLoader:Loader = new Loader();
imgLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, done);
imgLoader.load (new URLRequest ("001.png"));
function done(evt:Event):void {}
trace ("it happens at this point very well");
addChild (Bitmap (imgLoader.content));
}
}
Thank you!
Sorry! Of course, I surf the Internet for hours, unable to find a solution, according to a post on the forum, and then I have a solution.
http://StackOverflow.com/questions/5036650/AS3-addChild-in-a-class
I just forgot to add the addChild (MyCreature) in the main timeline. Duh.<>
Tags: Adobe Animate
Similar Questions
-
MacBook Pro (retina, 15 inches, beginning 2013) El Capitan 10.11.3, Simple question here: I can't open FinalCut Express (4, I believe). The wheel turns for hours. How can I install/uninstall and will I lose all my old films (for the most part stored on external hard drives). Thanks for your suggestions.
You will not lose anything, but the app if you uninstall. If you decide to uninstall use this app to make sure that all the other files which depends on FCE are also deleted however I can't give you any assurance as to whether you will be able to reinstall so that it works correctly. It is a software that has not been supported for almost 5 years and there are conflicting reports as to its compatibility with OS X 10.11. Can't I test it myself.
Maybe someone else will chime in with their own experiences.
Russ
-
I rebooted the free version of the Firefox browser, about two months ago. Since then, whenever I navigate, with few exceptions, Firefox displays a message bar at the top of the screen saying "Firefox prevented this site" with the message, there is a checkbox asking ' ALLOW? When I check ALLOW it most of the time, I get a web page, BUT on some occasions, Firefox keeps just block the page.
Sites and pages that I refer here are for the most part, places of TRUST.
This happened since I rebooted. It was NOT a problem before that.
It is VERY annoying and I have since passed to Google Chrome.
If you can offer any reasoning or explain why this is happening, I will be grateful.
Thank you. mLowe51Finally looks like a response to the blocking of the Government and other trusted sites
-
Is there anywhere I can look to see what is running or happening when my PC crashes?
BACKGROUND:
My PC has been freezing more frequently lately.
It seems to happen more often when I am on battery, usually when I am online using Firefox my default browser.
I tried checking the event viewer, but did not find much, and do not know, I am interested in the right part.
I can say without a doubt it happens when it is on battery power, almost never when it is plugged.
In addition, it seems to happen more frequently when I use Firefox, but then I'm usually just surf when I'm on battery. When I don't really work, I tend to sit at a desk and connect.
Here are my specs:
Product number: XG871UA
OS: Windows Home Premium Service Pack 1
Browser: Firefox Chrome for the most part, other times
I'm starting to capture when / where it happens the more frequntly in a strive to locate the problem.
I'll try to turn off Firefox addins / extensions as a first step, but would like any other tips.
Thank you!
IanI did a quick check this week, surfing on the battery while using Firefox, I fell two times. Once run it normally, first with all add-ons disabled.
When I switched to Chrome I had any problems.
I'll close this and call it a problem of Firefox, I'll open a new ticket if it appears elsewhere.
But I'll check the both battery test.
Thank you!
Ian -
Color laserjet 4600 - problem with one color (yellow) for the most part does not print
Colors look purpleish when printing photos. It turns out that this is a problem with yellow print.
We tried to replace the yellow toner cartridge, and it was not fixed.
PQ troubleshooting, the yellow page is empty except for a thin (16th of an inch) to 99% a horizontal line at the top of the page.
In the configuration page, all the different areas that should have the yellow are mostly empty, with the exception of the same sort of thin horizontal line at the top of each of these areas. After updating the firmware from 03.001.0 to 03.016.0: in addition to what is described on the configuration page, some of the fields in the configuration page that should be yellow, have a pale magenta and more this yellow line.
Our technician came several times and has so far tried to replace the hvps, scanner laser, toner alignment and trainer kit Board. Nothing has improved the question. Then for the replacement is the regulator dc ($1000).
Anyone here have an opinion on what could cause this problem? It seems they are just throwing parts at home and we're about to tell them to give up.
It wasn't the dc controller. I figured out well out - somehow, there was a spring missing behind one of the speeds in the train of drum roll.
-
Short and simple question - automatic update for the most part
Hello
I just inherited three installations of Essentials. Is anyway to get ESXi hosts updated automatically as if it was possible with the Update Manager and the other versions of vSphere?
See you soon
AWo
Because of the limited edition of Essentials functions, I'm afraid you'll have to patch update / hosts interactively. Same Update Manager is perhaps not very useful, because Essentials does not support the vMotion/DRS, and should not be any power on VM on the host to remedy. You will also need to find a workaround for the ESXi host on which vCenter Server runs, except the server instances vCenter for each Kit are run on hosts of the other Kit.
André
-
Mac mini (late 2012) OS 10.11.6 intermittent video on turn on. Only when you quickly turn off. Lights, chime occurs, but the video remains black. Monitor is ok. Usually can recover if it is closed for a while, then restarted. Verification of the material is good. (extended) First aid disk shows no problem.
Any ideas?
Have you tried another cable?
Another monitor?
-
My office does not display my theme Zapotecs, I'm especially a big box empty white to the right and Center, and a bunch on the left who is not white white. How to be the Zapotecs full desktop theme on my screen?
You can view other themes on your system?
If so, try to get a new theme "Zapotec" and try again.
If this is not the case, check that the Windows themes service is enabled and running.
Use the following steps to check if your themes service is enabled:
1. open your Start Menu, and then click Run
2. type in: Services.msc
3 locate the themes service in the list of services and double-click it.
4. set the startup type on: automatic
5. click on apply, then Startand OKIf the other themes of work, but can't always the Zapotec theme to work, then most likely it is corrupt.
-
How to calibrate the screens of Adobe products? I will mostly use Illustrator and Photoshop.Can make all the difference between calibration and the Hardware calibration software using (Spider)? Thank you.
I use U2415 from Dell.
I use the Spyder Pro 4. The process is quite simple - install the software, plug the Spyder and follow the steps listed in the program. I would recommend also, install the latest version of the software directly from the site of Datacolor instead to install from the disc supplied (probably outdated).
Benjamin
-
The keyword of Office Word mac is all mixed up. However in excel are more in their own as well as what I write today. Can you help me please?
Mac OS 9 is 16 years old. I asked that your post moved to the forum of Mavericks, since that's what you have published in your signature.
-
I don't know even what happened to my unit. It was working fine, then I tried to send some documents in JustCloud to get space on the myhard drive. All myicons then turned to the sheet of paper, and I can not cannot hardly straighten out such things. If I take it to someone to fix it, I'll never know what happened. They do not give you their secrets, but of course they will charge you!
You have an anti-malware protection, you can run analyses? See thread of Vincenzo Di Russo on some good suggestions on ensuring that your system is clean of the infection: http://answers.microsoft.com/en-us/windows/forum/windows_vista-security/how-to-get-rid-of-malware/ba80504b-61f1-4d71-960f-b561798b7b42
-
I want to archive TV shows that were recorded on DVD that is formatted in VR mode rather than in video mode. My operating system is Vista business and therefore does not include the Media Center. I can play DVDs on the computer, but cannot transfer files from their hard drive. Windows Explorer does not work unless the DVD are formatted in video mode.
Hi GeoffreyHawkins,
This feature is not supported by Windows.
However, you can use your favorite search engine & download any third-party software that could serve the purpose.
Note: This response contains a reference to third party World Wide Web site. Microsoft provides this information as a convenience to you. Microsoft does not control these sites and no has not tested any software or information found on these sites; Therefore, Microsoft cannot make any approach to quality, security or the ability of a software or information that are there.
Hope the helps of information.
-
Anyone able to help get the icons of my return to the e-mail toolbar?
Click view > customize toolbar > drag the default toolbar in your toolbar (or drag the tools you need)
EDIT: To post your picture, completely exit Mail, then restart the computer.
If it looks like still wobbly, do a Boot secured and open Mail there.
-
This is a general problem: 'help sysytem' structure has been changed (perhaps in part I dion can't Koe) then the flow of questions from the ends up to non-existent (existing is more..) tips, suggestions, or instructions set how, not more existing or operating.
Very frustrating.
I raise my profile under Linux on the terminal with something like "find - name *.mab"and got it in a split second." None of the ways suggested later in the help worked!
This is a general question for site designers, thanks for help [actually: it's the Help menu...]. Welcome,
Giancarlo.
Please follow the trail of help: you will get what I say, sorry. g.@Zenos. Thank you very much for your screenshot, which solved the issue.
I have a Tundebird for Linux version, which, as far a s I see, is somewhat different from what you have. The previous version had not all submenus as you show, however, he recent update I made 'my' Thunderbird earned him almost to what you posted simply we had different programs.
I suggest that it closed the thread. Thaks to all to help.
Giancarlo. -
8.6.1 in lv 2009 update, missing lv vi, for the most part DAQmx errors
I created an application with LV 8.6.1. I have two 8.6.1. and lv 2009 on this computer. When I click on the shortcut, lv 2009 automatically tries to load the application and gives me errors because it cannot find the sub live, for most of the screws of DAQmx.
1 - is there a way I can get the shortcut to automatically load lv 8.6.1?
2 are there in fact files I am missing that prevents the application from loading in LV 2009?
I don't know what shortcut you are talking about. If it is a shortcut to the exe file, neither 8.6.1 or 2009 will begin. If you have a shortcut to a project or VI, then the version of LabVIEW that you last started will be charged. Just manually start 8.6.1, close it and next time 8.6.1 will begin.
LabVIEW 2009 requires you to install DAQmx. You have a version compatible with your distribution of 2009. You can also download 8.9.5 or version 9.0.0.
Maybe you are looking for
-
2009 MBP is slow under 10.11.6
Hi, I'm using a 2009 MacBook Pro (2.53 Ghz 4 GB ram) and I'm really confused... I signed up for the beta program, but, according to allmac.com, El Capitan is the latest version of the operating system is running on this computer... since I was forced
-
Replaced my black ink text and got a message error "is missing or defective print head. The print head seems to be missing, not detected, or incorrectly installed. "She will not have the menu on the printer, to come. I took the cartridge and reinsert
-
I have a Sansa e260 - but which version?
How can I find out what version of Sansa e260 I? I need to crack the case? In the lower right corner of the back, it says "model: e260 ' without reference to any version - so is this R1? Thank you for watching this... Robert
-
Original title:. network controller error? the device, network controller, is not understood correctly. report "tv_ConfigMgrErr1". Impossible to download whatever it is or it causes Internet Explore stops working. I get a diagnostic report saying tha
-
do I need this product on my laptop