Cannot understand the organisation of children at all
Can someone please explain some things to me? I have two classes. One is the document class:
package {
import flash.display.*;
import flash.events.*;
import fl.motion.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class SlideShow extends Sprite {
private var viewer:ImageLoader;
private var images:Array=new Array("images/seats.jpg","images/office.jpg","images/wall.jpg","images/light.jpg","images /elephant.jpg");
private var count:int=0;
public function SlideShow() {
viewer=new ImageLoader();
viewer.x=100;
viewer.y=100;
viewer.setUpTextField(this);
addChild(viewer);
loadImage();
next_btn.addEventListener(MouseEvent.CLICK,nextPicture)
prev_btn.addEventListener(MouseEvent.CLICK, prevPicture)
private function loadImage():void{
if(count>images.length-1 || count<0){
count=0;
viewer.loadImage(images[count]);
private function nextPicture(e:Event):void{
viewer.removeImage()
count++;
loadImage()
trace(viewer)
private function prevPicture(e:Event):void{
viewer.removeImage()
count--;
loadImage()
The next is my ImageLoader class:
package {
import flash.display.*;
import flash.net.URLRequest;
import flash.events.*;
import flash.text.*;
import fl.motion.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class ImageLoader extends Sprite {
private var loader:Loader;
public var progress_txt:TextField;
var img:Bitmap;
var parent_mc:SlideShow;
public function ImageLoader() {
loader=new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, showImage);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);
public function loadImage(url:String) {
var URLObject:URLRequest=new URLRequest(url);
loader.load(URLObject);
private function showImage(e:Event) {
progress_txt.visible=false;
img=Bitmap(loader.content);
img.alpha=0;
loader.unload();
addChild(img);
var myTween:Tween = new Tween(img, "alpha", Strong.easeOut, 0, 1,100)
trace(next_btn.x)
public function removeImage():void{
removeChild(img);
public function setUpTextField(obj:Object):void{
parent_mc=SlideShow(this.parent);
progress_txt=new TextField();
progress_txt.text="Loading";
progress_txt.x=0;
progress_txt.y=0;
var tf:TextFormat=new TextFormat();
tf.font="Arial";
tf.size="18";
tf.align="center";
progress_txt.defaultTextFormat=tf;
obj.addChild(progress_txt);
//couldn't work out why I couldn't say parent_mc.addChild(progress_txt);
private function showProgress(e:ProgressEvent){
progress_txt.text=String(Math.round(e.bytesLoaded/e.bytesTotal*100))+"%"
Problem is with accessing the buttons.
I manually placed two buttons on the stage and called them next_btn and prev_button. How on earth do I access these buttons from inside the ImageLoader class? I have no clue as to the hierarchy. When I say inside imageLoader.as trace(this.parent) I get NULL, which confuses me, because something has added it to the stage, I thought it was the document class SlideShow.
I tried trace(this.next_btn), (next_btn), (this.parent.next_btn), (stage.next_btn)....where on earth is the next_btn???
pass a reference to the stage from your document class to you imageloader class.
Similar Messages
-
I upgraded from v3 to v6. Firefox Sync lost hundreds of my bookmarks - it kept all the organised ones, but lost all the unsorted's. I'm now facing an inquiry at work, and could cheerfully kill Mozilla. However, is there any way to fix this?
I did read what you posted, and will point out once more - the organised bookmarks were kept, the unsorted - the majority - were lost. I tried accessing them THROUGH sync as I couldn't find them before I started sync and thought that might help. Really didn't. Sync was only loaded with version 6, never used it on 3. Updated from 3 to 6; tried to find bookmarks. All unsorted ones GONE. accessed sync; no bookmarks. went back to three. never shifting again, version 6 is a quick trip to hell. Should have known not to trust the program to preserve bookmarks, blame myself for being so bloody stupid to trust it to keep my information safe. Moral: always save multiple backups.
-
Hi frnds my name is raj , i am very new to OBIEE , i have been pracitcing it on my own and now i had few problems in understanding the errors .
I built a physical layer with CHANNELS ,COSTS , COUNTRIES , PRODUCTS , SALES ,TIMES tables and SALES being the fact table ,,, I have physical joined every column except COST to sales .
And in Bussiness layer i have created a new bussiness model and dragged all the tables from physical layer except COST table..
In BMM layer , in Sales Table i have dragged a column named UNIT_COST from cost table in physcial layer and renamed it to unitcost , so the sales table in BMM layer has two sources i.e., SALES and COSTS .
Now i applied aggergation sum rule on UNIT COST and dragged it to presentation layer ...
When i opened the presentation server , and selected Product name from product table and Amount sold and Unitcost from sales table and when i click the results to view i have encountered with an error
ODBC DRIVER RETURNED AN ERROR(SQLEXECDirectVV)
the message says : UNIT_COST : invalid Identifier at OCI call .
Please help me in understanding this error and kindly give me the solution for it
thanks ...Hi,
Firstly did you make a "view data" in the physical layer for the COSTS table. I am doubting that this table wasnot created in the db itself. Kindly check it and let us know if you have any issues
Regards,
BI Learner -
These are my last two crashes. I tried all that is commonly advised, but crashes are still frequent, about once or more every day.
bp-dd8c6382-a254-4f16-aaf8-257152140313
bp-98dc2419-5892-4cf8-89a7-ce3382140312
Thankshello mozi108, i'm locking this thread, because you already have created a similar question yesterday at https://support.mozilla.org/en-US/questions/989596. please put all new information about the crashing issue there instead of opening new questions for it, so that contributors can follow up on you more easily. thank you!
-
''locking this thread as duplicate, please continue at [https://support.mozilla.org/en-US/questions/989596 /questions/989596]''
AND AGAIN AND AGAIN...
other two crashes in the last few minutes:
bp-e23f3f47-df28-49aa-9117-870ee2140313
bp-e656c64b-ddaa-4ca1-ab0a-2daea2140313hello mozi108, i'm locking this thread, because you already have created a similar question yesterday at https://support.mozilla.org/en-US/questions/989596. please put all new information about the crashing issue there instead of opening new questions for it, so that contributors can follow up on you more easily. thank you!
-
Cannot understand the output of x*y
Hello All,
I was running the following program.
import java.io.*;
public class Basics {
public static void main(String[] args) {
System.out.println("---------" + args.length + "---------");
System.out.println("argument is " + args[1]);
If i run the program with arguments 3+4(numbers could be anything),it runs fine ,provides the desired output.
But if i run the program with 3*7 as its arguments it gives me the following output.
---------9---------
argument is .classpath
*Please explain why this difference in outputTry:
public class Basics {
public static void main(String[] args) {
System.out.println("---------" + args.length + "---------");
for (int i = 0; i < args.length; i++)
System.out.println("Argument #" + i + " is: " + args);
It may be more revealing... -
How to recharge the battery for I-phone4????????????
Hello Marynoemi
Have you tried reset all settings
settings > general> reset > reset all settings
if that doesn't work try following this http://support.apple.com/kb/HT4137?viewlocale=en_US&locale=en_AU
you should probably also try another cable and charger if you have one and if that doesn't work call apple. -
The answers that your website have provided have not done me any good. I use a Master Password for Firefox. Now Firefox is not asking me if I want it to remember a certain password that I have entered for a website. In the 'Options' tab, I have told Firefox that I do not want to be tracked; that I don't want it to remember the history; and not to accept third-party cookies. What is it that I have to do in 'Options' so that Firefox remembers a new password (I have changed a password recently). I would really appreciate an actual answer, rather than a link to "some answers already posted".
I'm using Firefox 33.1. Windows XP - Service Pack 3.
Thank you.Are you saying that you changed your history setting here:
"3-bar" menu button (or Tools menu) > Options > Privacy
to "Firefox will: Never remember history"?
This causes Firefox to always start up in a private browsing session. According to the help article "[[Usernames and passwords are not saved]]":
<blockquote>If you use the Firefox Private Browsing feature, no passwords will be automatically filled in for your Private Browsing window or in permanent Private Browsing mode, and no new passwords will be saved.</blockquote>
So hopefully that helps connect the dots.
If you prefer to keep using automatic private browsing, you may need to use an add-on to manage your passwords instead of Firefox's built-in password manager.
Or if you want to adjust other Firefox settings so that they are as close as possible to private browsing, we can suggest how to do that instead. -
HT201210 I did an update today and now I cannot get the phone to work at all
I did an update on my 4S today and now I am not able to turn the phone on!
It shows the cord connecting to iTunes but does not respond to anything I do!
HelpYou must connect it to your computer, and the computer must have the latest version of iTunes installed. If iTunes does not start restoring it see: http://support.apple.com/kb/HT1808
-
How can I change them? I have tried calling them, I have tried things that are already listed on Google for it, And the website, But it just doesn't help. Can someone please help me?
Click here and fill out the form.
(93139) -
class TrickyTest {
public static void main ( String args [ ] ) {
int i = 10 ; // line 1
i = ++i ; // line 2
i = i++ ; // line 3
System . out . println ( i ); // line 4
};The answer is 11. Why not 12?FFS!
1. NEVER write code like i = i++
2. Search the forum or google. This has been asked plenty of times. -
I have tried installing it at work
at home
but no luckHi,
Please refer to the help document below to fix the error message:
Error downloading, installing, or updating Creative Cloud applications
Regards,
Sheena -
In a example , i see "x*2n" for it. why !
Hey gpibssx,
The line mask is used to mask off the bits you are not interested in or you do not want to change. It is normally applicable when writing to a port.
For example if the existing port value was 0b00001111 and you are writing the value 0b10101010 to a port. If the line mask was 0b00000001 the new value written to the port would be 0b00001110. If the line mask was 0b00001111 the new value would be 0b00001010. If the line mask was the default 0b11111111 the new value of the port would be 0b10101010.
Basically the mask lets you know what values to change. I hope this helps out and let us know if this is still confusing.
Joshua P.
Application Engineering
National Instruments -
What is the mouse gesture to minimize all windows?
I am having trouble understanding the mouse gesture that minimizes all windows back into the dock. I keep on doing something which causes this to happen and I cannot figure out or find anywhere what this gesture is.
Do you mean ctrl-clicking the Composite Channel icon in the Channels Panel?
-
Problem in understanding the code
this particular code is given as stadard example in sap unicode conversion
this particular code is replcement for 'translate code page syntax'
this code describes how to use particular cl_abap_conv_in_ce classs
i cannot understand the 'buffer' field in this code
can any one tell me what is the meaning of buffer = '41424320' from where did he get this value?
DATA:
text(100) TYPE c,
int TYPE i,
buffer(4) TYPE x,
conv TYPE REF TO cl_abap_conv_in_ce.
conv = cl_abap_conv_in_ce=>create(
encoding = 'UTF-8'
endian = 'L' ).
buffer = '41424320'.
conv->convert(
EXPORTING input = buffer
IMPORTING data = text ).
buffer = '02010000'.
conv->convert(
EXPORTING input = buffer
IMPORTING data = int ).thank you mahmet i also want to check weather i am doing the code correct or not
i have old syntax in my program like 'TRANSLATE header-id FROM CODE PAGE file_tab-codepage'.
i am replacing the above syntax with the follwing code and can u correct me if i am wrong
data:
buffer1 type xstring,
conv type ref to cl_abap_conv_in_ce,
int type i.
conv = cl_abap_conv_in_ce=>create(
encoding = 'file_tab-codepage'
endian = 'L' ).
buffer1 = '41424320'.
conv->convert(
exporting input = buffer1
importing data = header-id ).
Maybe you are looking for
-
Searchin pattern in datbase table.(Number of rows in table :More than70Lac)
Actually i have a db table having 2 columns(columnA,time).db table has 70lac rows.I have to retireve all those values which are present min. 2 times in the interval of 10 minutes. eg. columnA,time values are {a,June-01-2011 10:13:12},{b,June-01-2011
-
Append or remove optional element
Hi! I have a schema based XMLType table, which has a optional element. How could I append(or remove) an optional element to(from) a xml instance in the XMLType table?. I need a help !!! Thanks.
-
Jdeveloper 10g book for beginners
hello could you please help me fined a good book to learn Jdeveloper 10g as beginner
-
Indesign CC has stopped scrolling
I have lost the ability to scroll vertically in ID CC. The scroll bar on the righthas disappeared, the hand tool won't do it, and my mousewheel gets no response. Any ideas out there?
-
What is the industry type & material types that are used in AFS Industry ?
Hello PP members: What is the common industry type & material types that are used in AFS (Apparel Footware Solution) industries Thank You