StartDrag() Works But Not The Buttons. Help Please.
Hi, I have a MC which I use this code to drag it:
ActionScript Code: on (press) { startDrag(this);}on (release) { stopDrag();}
This MC contains some buttons but these don't work. When I remove the code above, the buttons work. Is there any smarter way to get my MC mouse drag effect with those buttons inside? thanks mx-guest2004
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 02-01-2005, 02:54 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
- StartDrag() Works But Not The Buttons. Help Please.
- StartDrag Only Works On One MovieClip? Please Help
- StartDrag Works Locally But Not Online...
- StartDrag Movie With Buttons
- Question About StartDrag And Buttons
- Simple Buttons Won't Work After Startdrag And Stopdrag
- Help Needed: Buttons And StartDrag Not Working Through A LoadMovie Function
- Startdrag, Constrained Zone, Loosing Other Buttons Function
- Buttons To Movieclips...now Nothing Works, Please Help
- One Button Works - Two Buttons Do Not
- AddEventListener Works Only On New Buttons
- Code Works As 2 Buttons, But Not As One?
- XML Dynamic Buttons: This Works, This Doesn't
- Code For Buttons - Works In One Scene But Not Another
- Code For Buttons - Works In One Scene But Not Another
- 2 Scroll Buttons On One Page, Only One Of Them Works
- Added Preloader.....which Works, But Then Buttons In The Swf Don't Work
- Added Preloader.....which Works, But Then Buttons In The Swf Don't Work
- Movie Clip Buttons - The Animation Works, But No Action
- SwapDepth Works, But Also Puts The Movieclips Above My Border And Buttons...
- SwapDepth Works, But Also Puts The Movieclips Above My Border And Buttons...
- Accentuation Works In Action Panel And Doesn't Works In A Class.
- Need To Make A Slideshow That Works On "next/pre" Buttons
- Can Someone Explain Me Why Preloader Works In Some Browser And Some Don't Works?
- Works On Local PC. Semi Works On Server.
- Printing:works..doesn't Work...works..?
- Printing:works..doesn't Work...works..?
- [F8] Horizontal Scrollbar Works, But Buttons On The Scrollbar Don't?
- MenuBar Works, But I Also Need "Next" And "Previous" Buttons.
- StartDrag()?
- StartDrag
- StartDrag Help
- StartDrag ?
- Help With Startdrag()
- StartDrag
- StartDrag Help
- StartDrag: Can You Help Me Out?
- StartDrag Help
- About StartDrag
- StartDrag=WTF?
- StartDrag (i Think)
- Startdrag
- I Cannot Use The StartDrag, I Must Use Something Else, Can You Help?
- StartDrag
- StartDrag On A Mc Help
- StartDrag Help
- Startdrag
- StartDrag
- StartDrag()
StartDrag() Works But Not The Buttons. Help Please.
Hi,
I have a MC which I use this code to drag it:
ActionScript Code:
on (press) { startDrag(this);}on (release) { stopDrag();}
This MC contains some buttons but these don't work. When I remove the code above, the buttons work. Is there any smarter way to get my MC mouse drag effect with those buttons inside?
thanks
mx-guest2004
StartDrag Only Works On One MovieClip? Please Help
Hi,
Attached is the FLA.
Here's the example
Here's the script on the dragMC:
code: onClipEvent (enterFrame) {
if (_parent._xmouse>0 and _parent._xmouse<132 and _parent._ymouse>0 and _parent._ymouse<364) {
this.startDrag(true);
} else {
this.stopDrag();
}
}
The startDrag() only works on one of the movieclips. Why is that?
Please help as my site is depending on having this functionality.
Thanks,
Flip.
StartDrag Works Locally But Not Online...
Hi All,
I have actionscript that works locally, works when i test in dreamweaver but refuses to work when i upload it to my client's server.
This is extremely exhausted because i completely changed the page around because the first effect i had did the same thing - worked locally and not online. And now the second effect is doing the exact same thing!!!
Can someone guide me to where the bottleneck might be...i'm stuck!
thx
StartDrag Movie With Buttons
Hi all,
In a movie i have 8 buttons.Can you drag a movie by using startDrag and still activate the buttons. I've tried with no luck. Is it possable and if so how..
Question About StartDrag And Buttons
Well I've read that you cannot use startDrag() on a button instance... and to accomplish this you must put the button instance inside a movieclip. And you place the following actions on the button instance...
on (press) {
startDrag(this);
}
on (release) {
stopDrag();
}
...and it all works fine. What my question is...
When you specify "this" inside the startDrag prototype (or method, or whatever it's called), does the script actually drag the button instance, or the entire movieclip that contains the button instance?
My understanding of "this" is that it applies to whatever it's used in. For example, we used it in the button instance, so in my head that means the script is dragging the button instance. But if that's true, why does it require you to put the button inside of a movieclip?
I hope I made sense... This is all just out of curiosity.
Matt
Simple Buttons Won't Work After Startdrag And Stopdrag
why doesn't my buttons that are in the MC: buttonmenu_mc, work?
i put the AS:
PHP Code:
this.buttonmenu_mc.onPress = function() {
// dragging buttonmenu_mc
_root.buttonmenu_mc.dragger_mc._visible = true;
startDrag(this);
};
this.buttonmenu_mc.onRelease = function() {
reActivateBtns();
changeOptionColor(this, overColor);
//this.enabled = false;
var old_x = this._x;
var old_y = this._y;
// moving position and scaling smaller of the buttonmenu_mc
this._x = Number(old_x);
this._y = old_y;
this._width = 500;
this._height = 200;
this.drag_txt.text = "Drag away";
// doesn't work?
this.drag_txt.onPress = this.drag_txt.onRollOver=function () {
this.text = "";
trace("dragtxt onpress");
};
_level0.myMCL.loadClip("page_info.swf", 5);
stopDrag();
};
if i onPress on this MC, it works, thus it drags..
after onRelease, it stops dragging. so that works.
But after onReleased, the buttons that are in that movie click don't work (won't trace, won't onRollover, won 't function), why?
Help Needed: Buttons And StartDrag Not Working Through A LoadMovie Function
Can anyone out there help with this?
I'm trying to solve this (probably simple) path issue, and am not having much luck.
I've got 2 files (see attached):
File 1 (ex2mainfile.fla) has one button only that, when clicked, should load File 2 (ex2.swf) into a movie holder. It's not working (see attached)
File 2 (ex2.fla) is a drag and drop activity in which:
- Users listen to each of 5 audio files, then
- Drag the accent name on the right (American, Irish, etc) to the correct drop zone on the left
PROBLEM
1. When you test ex2.fla by itself the drag and drop work fine. BUT, when you test (ex2mainfile.fla), the startDrag function won't work
2. I have a number of different files which are causing similar problems. Sometimes it's the startDrag which won't work, other times it's the cursor which won't work / won't change into whatever it's supposed to change into. (Is this the same pathing issue as the startDrag? Or is it a completely separate issue?
Can anyone help?
(See attached files)
Thanks in advance for your time
Rob
Buttons To Movieclips...now Nothing Works, Please Help
I have a quiz where the user has multiple choice options. When the user selects the button, it checks to see if that is the correct answer for that question. If the answer is correct it jumps to a frame that plays a little animation and then tells it to go back to the beginning of the movie. At the beginning there is code that resets all the buttons and all the questions.
First I had simple buttons in my movie that had this code on them
Code:
on (release) {
if (!hasAnswered) {
currentQuizItem.checkAnswerNumber(1);
}
hasAnswered = true;
}
Then I decided that I wanted a more complex button, so I decided to replace the simple buttons with movieclips. The code on the movieclips is as follows which is supposed to do exactly what the button did, except I added a little piece that tells the movieclip instance to go to certain frame in the movieclip.
Code:
on (release) {
if (!hasAnswered) {
currentQuizItem.checkAnswerNumber(1);
answer2Btn.gotoAndStop("checked")
}
hasAnswered = true;
}
Now, the movieclip button works for the first question of the quiz, but stops working after that. Why? All the buttons would reset properly. Why isn't the movieclip??
This is the code for resetting everything when it goes back to the beginning. Note: The new questions and answers (being loaded from external xml file) do load, but something in the code that assigns the answer to the button isn't working, b/c on the second question, the buttons no longer work, although they worked fine as simple buttons...and the movieclips work if i leave their property type as a button rather than a movieclip...is this normal??
Code:
var currentQuizItem = quizItems[currentQuestionNumber-1];
var hasAnswered = false;
question = currentQuizItem.getQuestion();
for (var i = 1; i<=currentQuizItem.getNumOfAnswers(); i++) {
_root["answer"+i] = currentQuizItem.getAnswer(i-1);
_root["answer"+i+"Btn"]._visible = true;
_root["answer"+i+"Btn"].gotoAndStop("notChecked");
_root["answer"+i+"Text"]._visible = true;
}
for (; i<=5; i++) {
_root["answer"+i+"Btn"].gotoAndStop("notChecked");
_root["answer"+i+"Btn"]._visible = false;
_root["answer"+i+"Text"]._visible = false;
}
if (currentQuestionNumber<15) {
questionType = "Knowledge Questions";
} else {
questionType = "Behavior Questions";
}
stop();
One Button Works - Two Buttons Do Not
Hi
Why does this single button work....:
ActionScript Code:
btnMENU.addEventListener(MouseEvent.CLICK, clickHandler1);
function clickHandler1(event:MouseEvent):void {
gotoAndPlay("menu");
}
...and this one, neither of the buttons work?
(Yes, one should"Play" and the other should "Stop"
ActionScript Code:
btnMENU.addEventListener(MouseEvent.CLICK, clickHandler1);
btnOBJECTIVE.addEventListener(MouseEvent.CLICK, clickHandler2);
function clickHandler1(event:MouseEvent):void {
gotoAndPlay("menu");
}
function clickHandler2(event:MouseEvent):void {
gotoAndStop("obj");
}
I only have only one instance of btnOBJECT on the stage. I copy/pasted the name from the Properties "<instance name>" field to the actionScript before ".addEventListener....." for the name, reducing misspelling. The symbol Properties are Buttons. btnOBJECT flies in from the left before it's static, but that's a timeline function, not AS3. It's too early to 'drink'. Help.
N.
AddEventListener Works Only On New Buttons
Hi,
I want to hook up an existing button to my code. I drag a button to the canvas, call it zoomin. My code in my app looks like this:
var zoominBtn:Button;
zoominBtn = _root.zoomin
zoominBtn.addEventListener("click", method);
Does not work.
When I create a button like this:
var zoominBtn:Button;
zoominBtn = tools_mc.createClassObject(Button, "zoomin", 0);
zoominBtn.addEventListener("click", method);
It works wonderfully.
Any idea ?
Cheers
B.
Code Works As 2 Buttons, But Not As One?
I've made a little demo fla so you can see what I mean, i can have 2 buttons, one that loads a movie that contains a dynamic text box, when i click first button it loads the movie, then the second one loads teh text into it, if i put the code together, loadmovie, then load text variable into text box, it doesnt work, gets as far as loading the movie, doesn't load the text.
I thought it might be the movie not being fully loaded before trying to put the textfile into it so it wasnt loading anywhere, so I made a function whereby the combined button loaded a variable (the name of desired text.txt) that was updated by each button to see if that would buy it some time but ive never made functions in AS before, might have been poor coding that stopped it. Just so you know what i tried already..
The reason I need it to load the movie is because other buttons load a different movie file and to get back to a text one it will need to load textmov.swf which only has a text box.
well, heres the demo
XML Dynamic Buttons: This Works, This Doesn't
Ok,
so I'm assigning dynamic values to a list of buttons; when pressed, they trace a dynamic value. The code works when I use attachMovie(), but not when I used loadMovie(to bring in thumbnails via xml).
I'm ready to throw my laptop out the window, but I'm sure its some little syntactic whatnot that's gumming up the works.
Here are the two slices of code:
this works!! (the xml is loaded, but data isn't being used):
function makeThumbs() {
_root.createEmptyMovieClip("thumbholder", 0);
_root.thumbholder._x = 100;
_root.thumbholder._y = 100;
var thumbXML:XML = new XML();
thumbXML.ignoreWhite = true;
thumbXML.load("videos.xml");
thumbXML.onLoad = function(success) {
for (i=0; i<5; i++) {
var thumb = this.firstChild.childNodes[i].attributes.thumb;
trace(thumb);
_root.thumbholder.attachMovie("square", "square"+i, i);
_root.thumbholder["square"+i].index = i;
_root.thumbholder["square"+i]._x = i*80;
//this works!
_root.thumbholder["square"+i].onPress = function() {
trace(list[this.index]);
}//
}
list = ["this", "that", "the other", "which", "where", "when"];
}
}
makeThumbs();
//this doesn't work!!! Thumbs load, but they don't respond to onPress behavior:
function makeThumbs() {
_root.createEmptyMovieClip("thumbholder", 0);
_root.thumbholder._x = 100;
_root.thumbholder._y = 100;
var thumbXML:XML = new XML();
thumbXML.ignoreWhite = true;
thumbXML.load("videos.xml");
thumbXML.onLoad = function(success) {
for (i=0; i<5; i++) {
var thumb = this.firstChild.childNodes[i].attributes.thumb;
trace(thumb);
_root.thumbholder.createEmptyMovieClip("square"+i, i);
_root.thumbholder["square"+i].index = i;
_root.thumbholder["square"+i]._x = i*80;
_root.thumbholder["square"+i].loadMovie(thumb);
//doesn't recognize this!!!
_root.thumbholder["square"+i].onPress = function() {
trace(list[this.index]);
}//
}
list = ["this", "that", "the other", "which", "where", "when"];
}
}
makeThumbs();
So, essentially, I need the XML loaded buttons to respond in the same way that they do in the first example. I can't understand what would make the first case work but not the second...
I've had this problem a number of times, and would love to settle it once and for all.
Thanks in advance!
Code For Buttons - Works In One Scene But Not Another
Ok, I'm not quite understanding this. Here is the code that I have put in my Actions layer:
Code:
stop();
btn_1.onRelease = function (){
this.gotoAndStop(2);
};
btn_2.onRelease = function (){
this.gotoAndStop(3);
};
btn_3.onRelease = function (){
this.gotoAndStop(4);
};
btn_4.onRelease = function (){
this.gotoAndStop(5);
};
The buttons don't work - at all. I've used this code in a separate scene for a skipIntro button, and it worked fine... Can anyone see anything wrong here? Am I supposed to enter the code elsewhere?
Thanks!
Code For Buttons - Works In One Scene But Not Another
Ok, I'm not quite understanding this. Here is the code that I have put in my Actions layer:
Code:
stop();
btn_1.onRelease = function (){
this.gotoAndStop(2);
};
btn_2.onRelease = function (){
this.gotoAndStop(3);
};
btn_3.onRelease = function (){
this.gotoAndStop(4);
};
btn_4.onRelease = function (){
this.gotoAndStop(5);
};
The buttons don't work - at all. I've used this code in a separate scene for a skipIntro button, and it worked fine... Can anyone see anything wrong here? Am I supposed to enter the code elsewhere?
Thanks!
2 Scroll Buttons On One Page, Only One Of Them Works
the problem:
while pressing on a button, the text should scroll down continuously while pressing. the problem is that it only scrolls down one line at a time while pressing, so you have to keep clicking instead of keep on press.
the problem only occurs when there are 2 sets of scroll buttons (first for dynamic text field 1 and second for dynamic text field 2). if there is only one, then it works fine. when there are both sets, only the second one works and the first does not. (i deleted the code for the second set of scroll buttons, and when i do that, the first set now scrolls fine while pressing.)
any clue as to why this is happening? here's the code:
TIA,
decibelle
//SCROLL ARROWS1
up_btn.onPress = function(){
press1 =true;
move1 = -1;
play_text.scroll = play_text.scroll + move1
};
up_btn.onRelease = function (){
press1 = false;
};
down_btn.onPress = function(){
press1 =true;
move1 = 1;
play_text.scroll = play_text.scroll + move1
};
_root.onEnterFrame = function(){
if (press1 ==true){
play_text.scroll = play_text.scroll + move1
}
}
down_btn.onRelease = function (){
pressing = false;
};
//SCROLL ARROWS2
up2_btn.onPress = function(){
pressing2 =true;
movement2 = -1;
play2_text.scroll = play2_text.scroll + movement2
};
up2_btn.onRelease = function (){
pressing2 = false;
};
down2_btn.onPress = function(){
pressing2 =true;
movement2 = 1;
play2_text.scroll = play2_text.scroll + movement2
};
down2_btn.onRelease = function (){
pressing2 = false;
};
_root.onEnterFrame = function(){
if (pressing2 ==true){
play2_text.scroll = play2_text.scroll + movement2
}
}
Added Preloader.....which Works, But Then Buttons In The Swf Don't Work
Hi.
Sorry, I have looked all throughout this site, and done multiple searches over the last few days, but still haven't figured this preloader out. From other posts I'm getting the impression that the tutorials for flash mx don't work for mx04.
I've done a good half dozen tut's on other preloaders aswell, which work....but all of them make my buttons ( that call in other external swf's) not function. Everything works beaut, without the preloader, so I imagine there is some conflict in paths.
The buttons in the main swf have
on (release) {
_parent.contents.loadMovie("1.swf");
}
I've tried swapping parent to root and to this. I've tried calling in levels, but it still ends up the same.
I appologize for another preloader thread, but I have been learning everything from the tutorials and forums at kirupa, and would be grateful for your help.
Cheers!
Mark
Added Preloader.....which Works, But Then Buttons In The Swf Don't Work
Hi.
Sorry, I have looked all throughout this site, and done multiple searches over the last few days, but still haven't figured this preloader out. From other posts I'm getting the impression that the tutorials for flash mx don't work for mx04.
I've done a good half dozen tut's on other preloaders aswell, which work....but all of them make my buttons ( that call in other external swf's) not function. Everything works beaut, without the preloader, so I imagine there is some conflict in paths.
The buttons in the main swf have
on (release) {
_parent.contents.loadMovie("1.swf");
}
I've tried swapping parent to root and to this. I've tried calling in levels, but it still ends up the same.
I appologize for another preloader thread, but I have been learning everything from the tutorials and forums at kirupa, and would be grateful for your help.
Cheers!
Mark
Movie Clip Buttons - The Animation Works, But No Action
Well, I've created a movie clip button that does everything I want it to do, except for load the next clip, or open a new window! Please help if ya can! What next?
on(rollOver) {
this.gotoAndPlay("buttonclip1");
}
on(rollOut, releaseOutside) {
this.gotoAndPlay("buttonclip2");
}
SwapDepth Works, But Also Puts The Movieclips Above My Border And Buttons...
I got swapDepths working great but when I change the depth of the movieclips (backgrounds for my site in this case) it also puts the backgrounds above the border and buttons of the site, which of course I don't want to happen. Here is the site w/o the swapDepths so you can see how it should work (I'm trying swapDepths to get rid of that flash between external movies):
>> Without swapDepths <<
I just need to know how to keep the border, buttons, and one other movieclip always above the backgrounds I'm swaping Depths. Also if you know how I can load the movie once then after its loaded just have the movieclips swapDepth that might help with the flashing as well. Right now I'm using this code (on the "Fantasy" button) Same code on the others, but different movieclip names and labels of course:
Code:
on (release) {
loadMovie("mcPyramid.swf", "_root.fantasy_container_mc");
_root.gotoAndStop("Fantasy");
_root.x +=2;
_root.fantasy_container_mc.swapDepths(_root.x);
}
SwapDepth Works, But Also Puts The Movieclips Above My Border And Buttons...
I got swapDepths working great but when I change the depth of the movieclips (backgrounds for my site in this case) it also puts the backgrounds above the border and buttons of the site, which of course I don't want to happen. Here is the site w/o the swapDepths so you can see how it should work (I'm trying swapDepths to get rid of that flash between external movies):
>> Without swapDepths <<
I just need to know how to keep the border, buttons, and one other movieclip always above the backgrounds I'm swaping Depths. Also if you know how I can load the movie once then after its loaded just have the movieclips swapDepth that might help with the flashing as well. Right now I'm using this code (on the "Fantasy" button) Same code on the others, but different movieclip names and labels of course:
Code:
on (release) {
loadMovie("mcPyramid.swf", "_root.fantasy_container_mc");
_root.gotoAndStop("Fantasy");
_root.x +=2;
_root.fantasy_container_mc.swapDepths(_root.x);
}
Accentuation Works In Action Panel And Doesn't Works In A Class.
Try attached code in Action panel and in a class.
The same code works in Action panel (F9) and doesn't works in a class.
For GOD!!!!
How can it be????
It's seems that someting is missing when a class is instantiated.
I and thousands of developers that writes with special characters won't have solution for this problem?
I mean that thousands of swf 8.0 version won't be migrated to flash9.
Adobe is concerned about that?
Any idea?
Attach Code
//Action panel works fine
import flash.text.*;
var txt:TextField=new TextField();
addChild(txt);
txt.text="áéÃóú";
//class doesn't works
package
{
import flash.display.*;
import flash.text.*;
public class TestAccentuation extends MovieClip
{
protected var txt:TextField=new TextField();
public function TestAccentuation ()
{
addChild(txt);
txt.text="áéÃóú";
}
}
}
Need To Make A Slideshow That Works On "next/pre" Buttons
Hi, we have a page that contains 2 buttons. One on the left side and one on the right side. One of em should be a next and the other prev. The clue is that its loading movieclips insted of pictures.
The starting movieclip has some menues and stuff like that, but everything is inside 1 movieclip. Then when i press the next button i want this to slide to the left/right and a new movieclip will slide inn. This movieclip wil also have some stuff on it inside the entire movieclip.
It will be a total of 4-5 of this movieclips.
Now how do i make this work.
I was looking around, but i didn't understand that much. Something i saw made sort of sence, but it was too much for me to handle.
If this would give an idea, it was made so you had all the movieclips in a list. And the buttons had a onRealese action to go to the next on the list, or prev.
The thing we mostly want is so it slides out and the new one slides inn.
Can anyone help? Thanks
Works On Local PC. Semi Works On Server.
Hi all
I have a flash site that works swell when I test it on my mac locally but then when I load it onto the server it doesn't work too well. Sometimes the swfs I load just don't load for some reason.
Here is the AS I use to load the swf. t is a value I pull from a XML file.
image_mcl.loadClip(t.swf, image_mc);
here you can see the site in inaction. Sometimes when you click on globe the swf doesn't load. Sometimes it does. Anyone have any suggestions?
http://wouter.freespeechpub.co.za/
Printing:works..doesn't Work...works..?
I have a Print button with this code:
Code:
on (release) {
Code:
print ("print_movie_x", "bmax");
}
Nice and straight forward...Users drag a number of cards round on the page then type in their name in an input box. Problem: When I click print, not only does all pages print(have 2 frames) but the cards appear as they did when you load the movie..they haven't moved...scary! What am I doing wrong? Any ideas people?Gab
Printing:works..doesn't Work...works..?
I have a Print button with this code:
Code:
on (release) {
Code:
print ("print_movie_x", "bmax");
}
Nice and straight forward...Users drag a number of cards round on the page then type in their name in an input box. Problem: When I click print, not only does all pages print(have 2 frames) but the cards appear as they did when you load the movie..they haven't moved...scary! What am I doing wrong? Any ideas people?Gab
[F8] Horizontal Scrollbar Works, But Buttons On The Scrollbar Don't?
I've done a scrollbar like this one:
http://www.kirupa.com/developer/mx/infinite.htm
It works fine.
However, I want the individual buttons (button1, button2, etc.) on the scrollbar to load an image from my library whenever they are pressed. I've loaded an MC (content_mc) above the scrollbar for which the images will be seen, and added the images to each individual frame. I used the actionscript from my last menu which works great, but this one with the scrolling MC menu does not work.
Code:
content_mc.stop();
speed = 3
target = button1._y;
for (var i = 1; i<4; i++) {
this["button"+i].pageNum = i;
this["button"+i].onPress = function() {
target = this._y;
content_mc.gotoAndStop(this.pageNum);
};
}
this.onEnterFrame = function() {
current._y += (tagert-current._y)/speed;
};
MenuBar Works, But I Also Need "Next" And "Previous" Buttons.
I have a menuBar that uses XML to generate multilevel navigation for a CD-ROM textbook. Menu works fine, but I really want to have a navigation button to go "Next" and "Previous" chapter/section.
I can't seem to get the actionscript to talk to the menuBar/XML nodes etc. Is there any way of getting the current menu "
I will attach relevant portions of code:
Attach Code
var partLabel:String = new String();
var chapterLabel:String = new String();
var hrefLink:String = new String();
var photoURL:String = new String();
var relatedURL:String = new String();
var nextSection:Object = new Object();
//-------------------------------------------------------------------------------------------
//------------------ Create listener used for "Contents" Menu and submenus. ------------------
change = function (eventObj:Object):Void {
if (eventObj.menuItem.attributes.label == "Exit") {
//mdm.Application.exit("ask","Are you sure you want to Exit?");
fscommand("quit");
} else {
//loads new content on menu click
updateContent(eventObj);
}
};
//
//------------------------ register the listeners with the separate menus ---------------------
my_mb.addEventListener("change", this);
//------------------------------------------------------------------------------------------
//------------------------ Updates the main text field and the chapter image ----------------
function updateContent(newContentNode) {
//---- load photo ----
photoURL = newContentNode.menuItem.parentNode.attributes.photo;
trace(photoURL);
photo_Loader.load(photoURL);
// ---- load text ----
hrefLink = newContentNode.menuItem.attributes.href;
var href_lv:LoadVars = new LoadVars();
href_lv.onData = function(src:String):Void {
if (src != undefined) {
main_txt.text = src;
main_txt.scroll = 0;
} else {
main_txt.text = "Error loading HTML document.";
}
}
href_lv.load(hrefLink);
currentMenuNode = newContentNode;
trace("Current Node reported from function call: "+currentMenuNode.menuItem.attributes.label);
}
//---------------------------------------------------------------------------------------------
//--------------------------------- NEXT article button ----------------------------------
next_button.onRelease = function() {
trace("Next button function - Current menu node is: "+currentMenuNode.menuItem.attributes.label);
nextSection = currentMenuNode.menuItem.nextSibling;
trace("Next menu node is: "+nextSection.menuItem.attributes.label);
nextChapter = currentMenuNode.menuItem.parentNode.nextSibling;
trace("Next parent node is: "+nextChapter.menuItem.attributes.label);
if (nextSection == null) {
if (nextChapter == null) {
trace("Case 3 - no more siblings following.");
break;
} else {
nextSection = nextChapter.menuItem.firstChild;
updateContent(nextSection);
currentMenuNode = nextSection;
trace("Case 2 - Next menu item is: "+currentMenuNode.menuItem.attributes.label);
}
} else {
updateContent(nextSection);
currentMenuNode = nextSection;
trace("Case 1 - Next menu item is: "+currentMenuNode.menuItem.attributes.label);
}
};
//----------------------------------------------------------------------------------------
StartDrag()?
I must be missing something here. I set my mc up to be dragged around the main stage when mousedown and stopDrag when mouse up. But I only want it to be able to be dragged when the mouse it over the clip. Right now when mouse down on any part of the screen it drags. What am I not doing right???? Hers my code so far:
onClipEvent (mouseDown) {
startDrag ("");
}
onClipEvent (mouseUp) {
stopDrag ();
}
This is on the mc thats loaded into the main.swf by a button action.
StartDrag
does anyone know how to edit startDrag (constrain to triangle) limits??
For example changing
<code>startDrag("drag-me", false,0,0,300,300)</code>
to
<code>startDrag("drag-me", false,50,50,300,0)</code>
I want to change a slider bar that has been previously created in another .fla and the movie exploper won't let me edit it??
thanks in advance
des
StartDrag Help
ok i made a move(site) and it loads a movie(navigation menu) so it wil lstay on top when u switch through scenes. and now i load another movie(cursor) so i can have a custom cursor...but now when u drag the navigation menu it stops dragging the cursor(MC)...can anybody help me out? basically what im trying to do is have a custom cursor and still be able to drag a menu, thanx.
StartDrag ?
Can someone please explain to me how the parameters of the startDrag function go. I have tried to make it work and I still cannot figure out why the clip will not drag in the place that I want it to. Thanks to all who help.
Help With Startdrag()
I know how to make something draggable, but I can't make it so that I can have more than one thing draggable. Can someone help me out? If I see the script I'll probably be able to figure it out.
check out my website: http://www.theultimatewebpage.com
StartDrag
I want to to be able to drag a movie clip but want to only be able to move it horizontally and only between to x points. I have looked up the start drag and the code is as follows.
_root.paddle.startDrag([true, 0, 0, 100, 0]);
This obviuosly doesn't work or I wouldn't be asking for help. For some reason it will still let me drag anywhere on the screen. Any help will be greatly appreciated.
StartDrag Help
If
StartDrag (true, 0, 225, 0, 400);
draggs from the left in the default settings, how do i get it on the right? i tried several combinations of the above with no luck.
[EDIT] Does the numbering go Left, top, bottom, right? Or does it go some other order?
[/EDIT]
-Thanks
StartDrag: Can You Help Me Out?
Hello,
i create a MC and i placed this code there:
on(press) {
startDrag(this, true, 0, 0, 110, 20);
}
on(release) {
this.stopDrag();
}
I have 2 questions:
1. Sometimes when i release the mouse, the MC keeps moving...why?
2. Shouldn't startDrag command work only with Buttons? What is going on here?
I am using Flash MX.
Thanks,
Miguel
StartDrag Help
I was wondering if anyone could help me, i have something that drags, but i want to block it so you can't drag it past a certain area.
I checked the actionscript Dictionary and it said that i can plug it into the start drag actionscript with left, right, top, and bottom; can any of you help figure out how in the hell i can do that?
About StartDrag
I have a object, and I have set it to move with mouse.
I want it move only up and down but not left and right.
So, how to write the script?
StartDrag=WTF?
ERm...
I dont see ANYTHING wrong with this fla. For some reason i put this on a button:
code:
on (press) {
startDrag(this);
}
on (release) {
stopDrag();
}
And everything in the movie starts dragging, even thigns that arent symbols. Please help this has to be the biggest WTF question.
please help this is a huge headache.
I attached the fla with it (MX format)
StartDrag (i Think)
ello.
probably gonna look like a bit of a newbie ere (which i am really ) But how would i go about something like this :
Ive got 1 movie with 1 scene
The canvas size is 100x100
I have movie clip1 thats 900x100 , and contains 9x 100x100 Movie clips(2-10) that each contain buttons.
On the movie start up the movieclip1 is at 0,0.
What i need to do is on the click of each button , drag the main Movieclip1 to new co-ords.
ie to see the 2nd movie clip in the line , drag the main movieclip1 to 100,0 , for the next 200,0 etc etc.
Dont want it to just appear though (or i may aswell use scenes) , after something like a 100 frame motion tween with "50 In"
I know this could be done by creating movie clips for every possible action , but surely there has to be some faster way ?
Cheers in advance
Matt
Startdrag
Hi people,
I have a problem about trying to use two statdrag which is not possible in Flash MX.
what I need is to be able to drag say an apply across a table and yet able to move the table across the floor.. the tricky part is when I move the table the apple will need to stay on the table.
dragging the apply is restricted to only the top of the table .. meaning we can't leave it off the table...
I was think of nesting buttons in movie clips having startdrag in each of them .. but as we all know it won't work..
any help ?
thanks for saving the half left of my hair! :-)
Kurt.
I Cannot Use The StartDrag, I Must Use Something Else, Can You Help?
Hi all, I have always used the startDrag and stopDrag to move elements around the stage. However because I am using this method for my hover captions, apparently you cannot apply this method for anything else otherwise it ruins the captions position. So I need to apply a different techneque to the other elements.
Can anyone provide me with the solution for this, as I am unsure on how to achieve this. The effect I am after is similar to windows, in terms of being able to move the windows about.
But with me not being able to use the startDrag emthod I am unsure on how to go about it, any ideas??
Please help
Trev
StartDrag
Hi, I could really use some help!!
I have a custom cursor that uses the startDrag() command. I also have a music volume slider that uses startDrag(). When I use the slider, the cursor drag disengages and the cursor no longer moves. Even after I release the mouse button, the cursor is still immobile.
Is there any way around this? Is there a way to drag multiple objects? Or is there a way to re-engage the cursor drag after using the slider? Or is there even another way of creating a slider that doesn't use the startDrag() command? (I don't think that makes sense, but you never know.)
Please help!! I'd really appreciate it.
Thanks a lot,
Carl
StartDrag On A Mc Help
Ok I have a bands website I'm working on, there are five members and I want it when the mouse is over each member there is a graphic/mc with the band members name on it.
It doesn't seem real hard but I'm struggling with it.
I created a mc over each member and dropped the alpha to 0% and gave each clip an instance name numbered one - five.
Here is the code I have so far...
code: three.onRollOver = function() {
aaron_name.startDrag();
};
three.onRollOut = function() {
aaron_name.stopDrag();
};
thanks to any of you that can help me,
StartDrag Help
I'm building a prototype that has a draggable portlet (movieClip). When you start to drag this movieClip, I want a highlight to appear that shows where this movieClip is going to land. I guess this highlight would be the hitTarget that would be triggered when I start to drag this movieClip.
to better explain see this:
http://www.giltstudios.com/startDrag/
Startdrag
hey, i have two questions. the first is this. i have 12 layers w/ a movie clip in each. in that movie clip i have 2 frames, a picture in both, and a tooltip on the second. i attached startdrag (true) to the tooltip, but it goes behind the movieclip pictres on higher layers in the main timeline. is there a way to tell this startdrag object to go to the highest level of any movieclip in the entire project?
the second question i have is: i have several times when i have to do the exact same animation for several different objects. so, is there a way i can make like a "master"clip that just animates the properties (blur, size, etc.) then i can just dynamically add each clip to that animated one? basically i only want to have to animate once for all 12 objects. if this isnt too hard or tedious please help me out. THANKS!
StartDrag
Hi I am trying to use startDrag by referring to a movie clip that I have called "box1_mc". For some reason it isn't working. Can anyone help me?
Thank you.
In the Actions Layer, frame 1 I have the following:
box1_mc.onPress = function() {
this.startDrag;
}
StartDrag()
Can it be slowed down?
Also, can we make it so that the little hand appears so that the user knows he/she can drag?
|