Clickable buttons within mc
Hello,
I'm working on a project and am having difficulty with a mc inside my swf. The movie clip is stopped at frame 1, showing only a small box with arrows in the top left corner of my swf. When MOUSE_OVER this box the mc plays and stops at frame(25). The mc (moveOut) has a motion tween where a larger box slides onto the stage, embedded are two buttons (toEur & toNeth) that will lead the user back to a different swf. The mc works fine, however if you mouse over either of the buttons it jitters or just goes to frame(1) and stops.
I think what is happening is that mousing over the buttons is considered mousing out of the mc. How can I make it that the mc plays as normal no matter if mouse_over the butons or not, but still make the buttons clickable? My code is below:
import flash.events.MouseEvent; stop(); moveOut.addEventListener(MouseEvent.MOUSE_OVER, playmc); moveOut.addEventListener(MouseEvent.MOUSE_OUT, stopmc); function playmc(e:MouseEvent) :void { play(); } function stopmc(e:MouseEvent) :void { gotoAndStop(1); }
I also tried to add this code, attempting to make the MOUSE_OVER on buttons just go to frame(25), better then the jitter thing.
toEur.addEventListener(MouseEvent.MOUSE_OVER, endmc); toNeth.addEventListener(MouseEvent.MOUSE_OVER, endmc); function endmc(e:MouseEvent) :void { gotoAndStop(25); }
I have yet to make the CLICK code for each button, this will involve unloading children swf's, which is another story!!!
Thanks in advance if anyone can help me!
I'm completely new to all of this, I didn't quite understand all of the commentJust keep on going, reflect on your experience and experiment again!
When I just started, I was unable to read AS3 Developers' Guide without howling at the Moon...
A couple of words in addition to what Ned said.
So as to set up a communication between your parent object and a child, which is loaded SWF, you DON'T need to use anything like LocalConnection.
You need to just load your external SWF and then 'talk' to Objects in it through referencing via dot (look at my sample code above (or below - it's closer...)).
I encountered some issues with using Loader class, but replacement with ProLoader fixed all.
import flash.events.MouseEvent;
import flash.display.MovieClip;
import fl.display.ProLoader;
var CPLoader:ProLoader = new ProLoader();
var ControlPanel:MovieClip;
addChild(CPLoader);
CPLoader.load(new URLRequest("ControlPanel.1920.swf"));
Loader.contentLoaderInfo.addEventListener(Event.COMPLETE, controlPanel_initialiser);
function controlPanel_initialiser(event:Event):void
ControlPanel = event.target.content;
ControlPanel.Power_BTN.ButtonArea.buttonMode = true;
ControlPanel.Play_BTN.ButtonArea.buttonMode = true;
ControlPanel.Pause_BTN.ButtonArea.buttonMode = true;
ControlPanel.Power_BTN.ButtonArea.addEventListener(MouseEvent.CLICK, currentSwitchClick_handler);
ControlPanel.Play_BTN.ButtonArea.addEventListener(MouseEvent.CLICK, currentSwitchClick_handler);
ControlPanel.Pause_BTN.ButtonArea.addEventListener(MouseEvent.CLICK, currentSwitchClick_handler);
Similar Messages
-
Get the value of a selected radio button within a ToggleGroup
All
Please see the script below. All I'm trying to do is to identify the selected radio button within a ToggleGroup. This has been working in JavaFX 1.2.
This is JavaFX 1.3 running on NetBeans 6.9 (beta) on Ubuntu 10.04
Does anyone know why this is no longer working?
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.control.ToggleGroup;
import javafx.scene.control.RadioButton;
import javafx.scene.layout.HBox;
import javafx.scene.control.Toggle;
def levelGroup = ToggleGroup {};
var selected: Toggle = bind levelGroup.selectedToggle on replace {
// here I want to capture the value of the selected toggle
// the outputted value is always 'null'
println("level toggle = {selected.value}");
println("selectedToggle = {levelGroup.selectedToggle.value}");
Stage {
scene: Scene {
width: 300
height: 300
content: [
HBox {
translateX: 100
translateY: 67
spacing: 20
content: [
RadioButton {
toggleGroup: levelGroup
text: "Easy"
selected: false
RadioButton {
toggleGroup: levelGroup
text: "Medium"
selected: true
RadioButton {
toggleGroup: levelGroup
text: "Hard"
selected: false
}Actually, your code above wouldn't have worked in JavaFX 1.2 as we only added the value property to the new Toggle mixin in 1.3. I believe what worked for you in 1.2 was when you referred to text, which is not a property on Toggle, so you need to cast the selected variable from Toggle to a RadioButton, which does have a text property. For example, this would work:
var selected: Toggle = bind levelGroup.selectedToggle on replace {
println("level toggle = {(selected as RadioButton).text}");
println("selectedToggle = {(levelGroup.selectedToggle as RadioButton).text}");
}Alternatively, instead of casting like this, you can store a value in the value property of the Toggle mixin class, which is extended by RadioButton. For example, your code could be changed to the following (in particular note that the only change is the addition of the value properties in each of the RadioButton):
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.control.ToggleGroup;
import javafx.scene.control.RadioButton;
import javafx.scene.layout.HBox;
import javafx.scene.control.Toggle;
def levelGroup = ToggleGroup {};
var selected: Toggle = bind levelGroup.selectedToggle on replace {
println("level toggle = {selected.value}");
println("selectedToggle = {levelGroup.selectedToggle.value}");
Stage {
scene: Scene {
width: 300
height: 300
content: [
HBox {
translateX: 100
translateY: 67
spacing: 20
content: [
RadioButton {
toggleGroup: levelGroup
text: "Easy"
selected: false
value: "Easy"
RadioButton {
toggleGroup: levelGroup
text: "Medium"
selected: true
value: "Medium"
RadioButton {
toggleGroup: levelGroup
text: "Hard"
selected: false
value: "Hard"
}This approach saves you from having to cast from Toggle to RadioButton. This second approach is actually very powerful, as you can store any object in the value field, and can then easily retrieve it at a later point when the user selects the desired RadioButton. Of course, you can just use it as in the simple case above as well.
I hope that helps. -
Making clickable buttons to open xml images in gallery
I want to do an xml grid image gallery similar to http://www.republicofcode.com/tutorials/flash/as3gridgallery/
However, instead of using thumbnails, I already have images on my site that I want to make clickable buttons to open the images in the gallery...how would I script these buttons?
[link removed by moderator]If you want it to be similar to the one you link then use the images in the grid like in the one you linked.
-
I have the following situation
MainMove.swf is doing a loadmovie of SecondMovie.swf
The Button that loads SecondMovie.swf also disables other buttons in MainMovie.swf
on (release) {
_root.intro_btn.enabled = false;
loadMovieNum("SecondMovie.swf", 2);
How do I Re enabled the Buttons in MainMovie.swf from a Button within SecondMovie.swf???
Using AS2 is this current project
Thankslol Sorry bout that I'm brand new here and was looking for the option to remove the post from the other location.
-
Button within a movie clip not working
Hiya,
I have a movie clip within my swf website that is basically
an icon that you roll over to produce the menu. The movie clip has
coding inside it to produce the rollover effect. This is as
follows:
stop();
this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
this.onRollOver = function(){
rewind = false;
play();
this.onRollOut = function(){
rewind = true;
Whilst this coding works fine for this movie clip, for some
reason the buttons within the movie clip that appear as you
rollover them will not work when pressed. I am trying to get them
to navigate the main timeline, i.e. coding as follows:
on (release) {
_parent.gotoAndPlay("home")
_parent should be correct, I've tried it without and with
_parent._parent however still it has no effect. From what I can see
everything should be working fine.
Is there some reason why buttons will not work within this
sort of roll over effect movie clip?
Thanks for your help.you can't assign mouse handlers to a parent movieclip and
expect a child movieclip to respond to mouse events: the parent
will intercept those events.
to remedy, either assign all your mouse handlers on the child
generation movieclips or use a hitTest() for one of the
generations. -
Question
on firefox clickable buttons are not clickable for me eg the + to open new tab ,the sign in . register and other applications buttons on this page wont click yet the 2 blue change buttons are fineTop of Firefox window non-responsive, toolbars non responsive -- also see [http://kb.mozillazine.org/Problematic_extensions Problematic extensions]
*caused by Yahoo Toolbar -- https://support.mozilla.com/questions/890908
*caused by Babylon Toolbar -- https://support.mozilla.com/questions/890670 -
Controlling the main time line of a movie via a button within a movie on a different level.
Hi there!
I have two movie is two different levels,
Level 5 is my base movie and I am loading another movie on
top of this into level 10.
Once the user clicks onto a button within the movie on level
10, I would like the animation in level 5 to stop (the animation
runs on the main root timeline of level 5).
Once the user clicks on a different button within the movie
on level 10, I would like the animation on the main timeline of the
movie in level 5 to start again from the point where it previously
left off.
Is this possible?
It would be great if someone could help me out with this.
Thanks, midi_iemidi_ie wrote:
> Hi there!
> I have two movie is two different levels,
> Level 5 is my base movie and I am loading another movie
on top of this into
> level 10.
> Once the user clicks onto a button within the movie on
level 10, I would like
> the animation in level 5 to stop (the animation runs on
the main root timeline
> of level 5).
>
> Once the user clicks on a different button within the
movie on level 10, I
> would like the animation on the main timeline of the
movie in level 5 to start
> again from the point where it previously left off.
> Is this possible?
_level5.gotoAndPlay("someLabelframe");
Use your regular action to target timeline or movie clips,
just define the level number at the beginning of the path.
Pretty much it :)
Best Regards
Urami
!!!!!!! Merry Christmas !!!!!!!
Happy New Year
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami> -
Can I place a "Return Button" within a clip?
Is it possible to place a button within a video clip that would enable a user to return to the previous menu? I am using submenus and to return to the submenu requires going back to the main menu and then back into the submenu.
24 inch iMac Mac OS X (10.4.8)Is it possible to place a button within a video clip that would enable a user to return to the previous menu?
short answer is no. However you can add a button for the main menu
If you have a project with submenus, you can add a button that viewers can click to go back to the main menu.
To add a button for the main menu:
Open the menu where you want to add the button and choose Project > Add Title Menu Button.
Hope this helps.
SDMacuser -
Can I make a cell in iWork 08 a clickable button?
Is there a way to assign a cell to be a clickable button which would take you to another spreadsheet?
The response is a simple : no.
Yvan KOENIG (from FRANCE dimanche 12 octobre 2008 12:00:55) -
I am trying to open a reference to a vi in the subpanel of the main vi. However after the vi opens in the subpanel and after pressing a few buttons in the subpanel the buttons in the main vi get locked, i.e. I can't even close the main vi or control anything else. Is there any way how I can avoid this happening?
> The buttons in main the vi get locked after opening a vi reference in
> a subpanel and using buttons within the subpanel.
>
> I am trying to open a reference to a vi in the subpanel of the main
> vi. However after the vi opens in the subpanel and after pressing a
> few buttons in the subpanel the buttons in the main vi get locked,
> i.e. I can't even close the main vi or control anything else. Is there
> any way how I can avoid this happening?
This is most likely happening because in either the top or sub panel,
there is an event structure that is queuing events, and is set to lock
the panel until the events are handled, and because of the logic in the
diagram, the events aren't being pulled from the queue.
So, you have a deadlock. You are waiting
on the panel. The panel is
waiting on the diagram. And the diagram is waiting on something else.
So, if there are indeed event structures involved, determine where in
the diagram things are delaying. Also, if you do not need the panel to
lock until the event is handled, you can change the setting in the
events dialog on the structure. But the events will still be queued
until the diagram starts executing.
Greg McKaskle -
Hello Guyz.
i am working on Macromedia Flash 8 and i just want to call a external SWF when i press the button within another SWF file.......but the second SWF file play Externely............can any one knows the code.... AS2try this
http://www.actionscript.org/forums/showthread.php3?s=&threadid=28123 -
Submit button within Interactive adobe form
Hi,
We have developed an Interactive adobe form and inserted a submit button within it We have installed ACI also.We tried putting the submit button both within the adobe form body and also within the webdynpro java view. In both the cases pressing the submit button does not result in any action. Please advise on what we are missing. We checked the forums for similar issues and found out that we are abiding by most of it.
thanks
anantharamHi Anantharam,
Please create and action in your view and attach it to your Interactive form UI element's onSubmit event. By doing this, whenecver you press the Submit button in the form, this action will be invoked. You can place any methots/code that you want to execute on click of submit button.
If you are using the button outside the form, then you try printing one of the values that you filled in the form which is binded to context. This way you can test.
If you are using WDP activex UI element s in the form then you need to have ACF installed on the machine and also ensure that the displayMode property of Interactive form is set to ActiveX.
Hope this helps!!
Regards,
Arafat -
Hyperlinks within a button / button within a rollover button?
Hi folks,
I'm quite the newbie here (print designer trying my hand at multimedia news projects), so I apologize in advance for sounding stupid a bit too often.
OK, so I'm working on a project, and it's going OK. What I want to do is for the user to rollover a button/object, and a little pop-up box will show up, and it will have some text/photos/... Pretty routine stuff. That I can accomplish without a problem...
Now, what I want to add in there is also a hyperlink that will open a Web page in a new window. And that's where I get stuck. It won't let me.
I assume it's because part of the rollover thing in the button symbol. That's how I'm doing it so far.
So, is there anything I can do going that route, or do I need to take another approach?
I'm thinking the other option would be to create a movie clip, which would hold the pop-up box and the photos and the like, then make a button within that which would hold the hyperlink. Then, I could create an object right on the timeline with a rollOver that would trigger the movie-clip instance.
Does that make any sense?
I'm using CS3, but I also have access to CS4 if needed.
Thanks in advance for your help!Hi Ned,
Thanks for the reply. I think I know what you mean. So anything that's triggered with a button cannot have anything inside triggered again.
To put it pretty simply, this is what I have:
There's a fever chart, and there are several points that I would like highlighted along the way.
So, when I roll over, say, the highest point, a balloon of sorts would pop up. It would have some text and photos and whatnot, but it would also have hyperlinks.
So... What's the best way to approach it?
I'm thinking the balloon of sorts would be its own movie clip, and all the goodies would be inside of it.
Now, to trigger it, should there be an object converted to a symbol to trigger it? Then, should I do a on(rollOver) kind of thing? When I roll over it, it would play that instance.
Or, the other option would be to do a rollover that would go to a certain layer/frame and play that.
What do you think?
Again, I'm sorry about my ignorance.
Thanks! -
Clickable button in Keynote?
Hi, I'm wondering if I can create a clickable button in keynote that would then trigger a build-in effect such as dissolve. Is such a thing possible?
draw a shape and ensure it is selected
in the Inspector > hyperlink > enable as hyperlink > click slide button and enter the slide number
place the object in slide 2 and create a dissolve to automatically build on entry for the object -
How do I center a button within a region? I tried 'align="center"' but this seemed to be ignored. The button is at the left of the screen. Also, what are the 'display points' (Page Template Region Position 1-8) used for, and why is there a specification for column position of 1-9? Could these be attributes that will allow my button to be centered on the window instead of on the left?
Thank you!Question was answered on another post.
Maybe you are looking for
-
Can you have more than one itunes account on a mac
is it possible to have more than one itunes account on a mac??
-
Logon to E-Business Suite Home E-Business Home Page
Hi, I am able to open raouf.oracle.com:8000 as well 127.0.0.1:8000. When i click Logon to E-Business Suite Home E-Business Home Page Following error is coming up Unable to connect Firefox can't establish a connection to the server at raouf.oracl
-
How to create process chain with dso and infocube at a time
hi friends, i have a FLATFILE in application server and i need to upload it to STANDARD DSO and i created a INFO PACKAGE and DTP for DSO. i have a STANDARD INFOCUBE to upload data from above DSO. here DSO is the source. i want to schedule this pr
-
Problem W/viewing videos on Safari
Lately all the videos I try to view stops every few seconds and reloads. Started this about a month or so ago. Am unable to correct this. Running Mac OSX version 10.6.8 with a 2.66 GHz Intel Core 2 Duo processor. Any solutions? New to Apple!
-
How to appload video on facebook using iphone4
how to appload video on facebook using iphone4