Solved

onmouseDown or onRelease ?????

Posted on 2009-07-01
19
421 Views
Last Modified: 2013-11-11
My mouse action is not working. (flash 8)
I do not even get the mouse hand on test play.
It is like the mc has no code at all.
Can you please help?
I tried this on the actions frame:
 

gallery1.onRelease = function (){

	gallery1.gotoAndPlay(56);

	kid1.gotoAndPlay(56);

}
 

or I tried on the mc
 

onClipEvent(mouseDown) { 

var MouseListener:Object = new Object();

 gallery1.onRelease = function() {

  kid1.gotoAndPlay(56);

};

}

Open in new window

0
Comment
Question by:lbusche
  • 9
  • 7
  • 3
19 Comments
 
LVL 3

Expert Comment

by:crittle1
ID: 24761147
make sure the mc instance name is gallery1

or you can try

on(release){
   this.gotoAndPlay(56);
        kid1.gotoAndPlay(56);

}

You will probably need to use the code this. in place of gallery1 since you are
referring the same movie clip.

Post back to see if it worked.. if not, I'll try look into it further.
0
 
LVL 3

Expert Comment

by:crittle1
ID: 24761153
Use that code on the actual movieclip. It is Actionscript 2 which I'm assuming you are using.
0
 
LVL 18

Expert Comment

by:Antonio Estrada
ID: 24765474
Although what crittle1 suggests will work, it's not ActionScript 2. It can be used while exporting for ActionScript 2, but it's a relic from AS1, the on(ACTION) statement is not recommended at all because it makes your code illegible soon after.

You should try to use this syntax at all times:

gallery1.onRelease = function (){
        gallery1.gotoAndPlay(56);
        kid1.gotoAndPlay(56);
}

If it didn't work there's probably an issue with the name of the instance object. Would you mind posting your *.fla?

-V
0
 
LVL 3

Expert Comment

by:crittle1
ID: 24765763
ah, thanks for the clarification :)
0
 

Author Comment

by:lbusche
ID: 24769211
Hey ,
Thanks a bunch.

In the meantime I found that this works.

      kid1.onPress = function (){
gotoAndStop(56);
      }

Where kid1 is the  mc instance.
gallery1 is the mc name.

Should I change something?
0
 

Author Comment

by:lbusche
ID: 24769313
hey do either of you know:

I want the code to print an external .jpg from my pic folder that is currently displayed in the mcLoader (a movie clip Loader). I know how to print from just a mc_thumbnail. That is not what I want.

extLoader_mc.

Thanks,
me
0
 
LVL 18

Expert Comment

by:Antonio Estrada
ID: 24773022
Do you mean actually printing what's shown on the Flash file to paper?

If so, take a look at the PrintJob class:
http://help.adobe.com/en_US/Flash/10.0_UsingFlash/WSB7FB8B27-9DF4-4089-9434-8AFF31584DA4.html
http://www.actionscript.org/resources/articles/206/1/The-PrintJob-class/Page1.html

-V
0
 

Author Comment

by:lbusche
ID: 24773636
No not the flash file. External links of a picture image........jpg.
Like this girls site.
http://www.edytajordan.com/galleries/ltcomfort/
I want the user to print the 300 res picture from my file of the picture they are viewing in the mc Loader.
Which is only a 72 res.
I just my print button to work.
My test site is: http://www.lynettesdesigns.com/
Let me know if you have a clue.
Thanks,
me
0
 
LVL 18

Expert Comment

by:Antonio Estrada
ID: 24773859
Yeah well, that's pretty much what I meant.

You can use the PrintJob class for that. You add MovieClip references to that class. Something like:

printButton.onRelease = function() {
    var my_pj = new PrintJob();
    var myResult = my_pj.start();
    if(myResult) {
        myResult = my_pj.addPage ("myMovieClip", {xMin : 0, xMax: 400,
            yMin: 400, yMax: 800},{printAsBitmap:true}, 1);
        my_pj.send();
    }
    delete my_pj;
}

Honestly I haven't used the PrintJob class in a long time, but there are some nice examples over here:
http://help.adobe.com/en_US/Flash/10.0_UsingFlash/WSB7FB8B27-9DF4-4089-9434-8AFF31584DA4.html
http://www.actionscript.org/resources/articles/206/1/The-PrintJob-class/Page1.html

-V
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:lbusche
ID: 24774419
Ok this is what I have now. The print box opens. Some thing is printing but I am out of black ink. It was a picture of an example picture from my printer. The save and close do not work. But they at least look like they are a movie clip button now.

print_pic.onRelease = function() {
    var my_pj = new PrintJob();
    var myResult = my_pj.start();
    if(myResult) {
        myResult = my_pj.addPage ("myMovieClip", {xMin : 0, xMax: 400,
            yMin: 400, yMax: 800},{printAsBitmap:true}, 1);
        my_pj.send();
    }
    delete my_pj;
}

save_pic.onRelease = function() {
    var my_sj = new SaveJob();
    var myResult = my_sj.start();
    if(myResult) {
        myResult = my_sj.addPage ("myMovieClip", {xMin : 0, xMax: 400,
            yMin: 400, yMax: 800},{saveAsBitmap:true}, 1);
        my_sj.send();
    }
    delete my_sj;
}



close_pic.onRelease = function() {
close_pic_mc.gotoAndPlay("family");
}

my buttons instances are print_pic, save_pi, & close_pic.
mc are printer, save_picture, and close_pic_mc
0
 

Author Comment

by:lbusche
ID: 24774423
sorry for got the c

my buttons instances are print_pic, save_pic, & close_pic
mc are printer, save_picture, and close_pic_mc
0
 
LVL 18

Expert Comment

by:Antonio Estrada
ID: 24774496
Uhh well, I think I'll have to take a look at the file to see what's going on. Can you upload it please?

-V
0
 

Author Comment

by:lbusche
ID: 24774771
0
 
LVL 18

Expert Comment

by:Antonio Estrada
ID: 24774860
Ok, the following code should do the trick:

<code>

-V
print_pic.onRelease = function() {

    var my_pj = new PrintJob();

    var myResult = my_pj.start();

    if(myResult) {

		myResult = my_pj.addPage("picViewer_mc");

        my_pj.send();

    }

    delete my_pj;

}
 

save_pic.onRelease = function() {

	getURL(picViewer_mc.picLoader._url);

}
 
 
 

close_pic.onRelease = function() {

	var mcLoader:MovieClipLoader = new MovieClipLoader();

	mcLoader.loadClip("",picViewer_mc.picLoader);

	_parent.gotoAndPlay("family");

}

Open in new window

0
 

Author Comment

by:lbusche
ID: 24774920
Vulturous, you are great.
I have been pulling my hair out.
I luv u.........one thing though the close just closes the current picture.
I suppose that is cool also. But i know the code is trying to tell it to go back to frame "family"
Am I right?
Do I have a stop somewhere that I should not?
I wish I were a pro like you.
I think I can actually sleep tonight.

0
 
LVL 18

Accepted Solution

by:
Antonio Estrada earned 500 total points
ID: 24774970
Actually I didn't know what the close button had to do, so I just assumed that it had to "close" the picture and go back to the "family" frame. I didn't try clicking on the other buttons so I'd never have to return to the "familiy" frame, so it was bugged - my apologies for that.

Here's the fixed code for that part:

<code>

And I'm glad to help.

-V
close_pic.onRelease = function() {

	var mcLoader:MovieClipLoader = new MovieClipLoader();

	mcLoader.loadClip("",picViewer_mc.picLoader);

	this._parent.gotoAndStop("family");

}

Open in new window

0
 

Author Comment

by:lbusche
ID: 24775383
You are a life saver.
I want to thank you so much.
It all works. xxxooo
I would love to get a hold of you again if I may.
I put my email up on my site. I will keep it there for a day.

Happy 4th to you.
Again thanks so much for sticking by your computer and helping me. I owe you.
I went to get my ink and love it. I may need to change the res on some photos, but all is ok.

me
0
 

Author Closing Comment

by:lbusche
ID: 31599031
He is the greatest.
Thanks
0
 
LVL 18

Expert Comment

by:Antonio Estrada
ID: 24775634
I'm extremely glad you got it working, in the end we're here to help and comments like yours are exactly what keeps us going :).

Yep, you can get a hold of me anytime, my contact information is in my profile (though, if it's a question, it'll have to be here first so if someone else runs into the same issue, they can read from here).

Happy 4th to you too, and again; I'm glad it's all working fine now :).

-V
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
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.

760 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now