Component Conflicting With My Main Swf
Hey everyone,
I have constructed the menu on my Main.swf file to load content through Page1.swf, Page2.swf, Page 3.swf, and so on. Due to the way my menu works the content is loaded kind of different. When you release one of the buttons, the actions look like this...
createEmptyMovieClip ("contentholder", getNextHighestDepth......ect....
There's more to it....it eventually uses loadMovie to pull the SWF.
The menu is pretty complicated. But it does function on its own when I place some dummy swf files for it to load.
When I add the MediaPlayback component, or the Scrollbar component in any of my content SWF files. My menu no longer functions properly. It seems like my menu is confused by the actionscript on the components. Any of the SWF that have no components work with the menu properly.
I also noticed that even when I add one of those components to the library of my Main.swf, the menu will not function.
Not the greatest at actionscripting but trying to skim my way through it. Looked around for about 9 hours now and best I could come up with is _lockroot. Either that or a depth problem. I figure I need to segregate the Main.swf from the ones with the components when they're loaded. Haven't been successful. Willing to send FLA if need be. THANKS A MILLION!
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 03-24-2005, 08:30 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Component Conflicting With My Main Swf
Hey everyone,
I have constructed the menu on my Main.swf file to load content through Page1.swf, Page2.swf, Page 3.swf, and so on. Due to the way my menu works the content is loaded kind of different. When you release one of the buttons, the actions look like this...
createEmptyMovieClip ("contentholder", getNextHighestDepth......ect....
There's more to it....it eventually uses loadMovie to pull the SWF.
The menu is pretty complicated. But it does function on its own when I place some dummy swf files for it to load.
When I add the MediaPlayback component, or the Scrollbar component in any of my content SWF files. My menu no longer functions properly. It seems like my menu is confused by the actionscript on the components. Any of the SWF that have no components work with the menu properly.
I also noticed that even when I add one of those components to the library of my Main.swf, the menu will not function.
Not the greatest at actionscripting but trying to skim my way through it.
Looked around for about 9 hours now and best I could come up with is _lockroot. Either that or a depth problem. I figure I need to segregate the Main.swf from the ones with the components when they're loaded. Haven't been successful. Willing to send FLA if need be. THANKS A MILLION!
Nested MovieClip Conflicting With Main Timeline
Well, I have a fla that's broken into 2 frames on the main timeline, the preloader(frame 1) and the content(frame 2).
Code:
stop();
onEnterFrame = function(){
var total:Number = _root.getBytesTotal();
var loaded:Number = _root.getBytesLoaded();
if (loaded >= total && loaded > 0){
//trace("loaded");
delete onEnterFrame;
play();
}
}
This code works correctly and once the entire swf has loaded it plays to frame 2 where I have a stop(); which also works.
Where I run into trouble is when my content comes up. I have 4 different 'destinations', each runs while setting declarations and comes to a stop(); frame with the following code:
Code:
stop();
var nInterval = setInterval(Play, 7000);
function Play() {
if (!_root.paused) {
clearInterval(nInterval);
gotoAndPlay("2nd");
}
}
The gotoAndPlay changes based on where you happen to be in the content, but the identical setInterval code is used, including var/function names.
Running on autopilot like this shows zero problems. The trouble comes from the buttons I have assigned to navigate these 4 frameLabels. On the same frame the buttons navigate to I have a clearInterval set, so regardless where you click to or from the interval is cleared.
The symptoms I see is that, when I am on the first of the four sections of content and I navigate to the fourth, my declarations are set, I can trace and prove that it is reading every bit of code, yet it goes and completely ignores my stop(); command in the nested clip and the MAIN timeline suddenly starts looping and so ignores the stop(); command on the second frame of the main timeline.
The code it sees upon navigating there is no different than on the first/second/third.
This is the frame it sees immediately on release of the button:
Code:
modIterator = 4;
_root.firstLoad = false;
clearInterval(nInterval);
btn1.gotoAndPlay("off");
btn2.gotoAndPlay("off");
btn3.gotoAndPlay("off");
btn4.gotoAndPlay("on");
And then 9 frames later it sees:
Code:
stop();
var nInterval = setInterval(Play, 7000);
function Play() {
if (!_root.paused) {
clearInterval(nInterval);
gotoAndPlay("1st");
}
}
I can trace at any point in either frame and confirm that it is indeed getting there, but it completely ignores the stop(); . The only difference between this content and the others, is that nested further in is an XML Loader, throughout the rest of the swf there is FLV components, combo boxes, etc. all pulling in data dynamically so I don't see that making any difference.
Any ideas whatsoever would be appreciated, been trying ALOT to get this sucker working today.
The Mediacontroler Component But On The Main Timeline
Hi, was using flv file and the mediacontroler component to enable people to control some embedded movies.
On this movie that I want to use is a recording of a powerpoint show and then jumping in an out of other applications.
This only a small part of the demo need to be animated - so I would really just like to use still frames in flash and then add the frame based animation - but with the audio track the same.
Basically - I would like to use the mediacontroler component - but just with the timeline - not with an imported flv?
Is this possible?
M@?)
Component To Control The Playing Of The Main Movie
Hi everybody,
I haven't ever created a movie with a media controller before, and I do not know how it is done.
If I have a main movie, with movieclips loaded into levels, or into other movieclips, how can I create (or use a component) to control the playing of the main movie (and everything that happens in the movie), so I am able to rewind, pause and play?
Thank you very much for your help.
Peace,
Cayo Hueso
Component To Control The Playing Of The Main Movie
Hi everybody,
I haven't ever created a movie with a media controller before, and I do not know how it is done.
If I have a main movie, with movieclips loaded into levels, or into other movieclips, how can I create (or use a component) to control the playing of the main movie (and everything that happens in the movie), so I am able to rewind, pause and play?
Thank you very much for your help.
Peace,
Cayo Hueso
Loader Component Holding External .SWF Control Main Timeline?
Hey sorry to cross-post but i don't think it's possible to move my existing topic to this forum!
FLASH 8
ACTIONSCRIPT 2
This code is being executed from an external .SWF inside of the loader component. it loads the movie, but the progress bar isn't working for this.... anyone gotta tip?
basically: main.swf has 2 loader components ("loader" and "loader2" in seperate locations, and a progress bar ("Pbar") component on the timeline. main.swf loads movie2.swf into "loader", and "pBar" shows the loading status just fine. there is a button inside of movie2.swf that triggers main.swf to load movie3.swf into "loader2". it shows up fine, but the progress bar doesnt work for this second loading action.
Code:
on (release) {
_root.pBar.source = _root.loader2;
_root.loader2.contentPath = "movie3.swf";
}
Something Seems To Be Conflicting
i have a movie clip that i have given a rollover function to make it play, however i only want it to play once and stop at it's last frame.
here's the script i've attached to the movieclip.
onClipEvent (load) {
this.onRollOver=function(){
if (this._currentframe==1){
play();
}
}
}
this all works fine, the only problem is at the very end of the movie clip i have embedded a button, and when i test the movie the button loads up but i can't seem to access it's rollover or press functions.
if anyone could help it would be greatly appreciated
Conflicting Scripts? Maybe? Maybe Not?
I have two seperate .swfs. Both of which are using the startDrag() command to create a scrolling effect. However, the main .swf has an _x scroll while the .swf I'm loading has a _y scroll.
I believe, but maybe far from the truth, that once I load the _y scroll .swf into the main file the loaded .swf then will not scroll, at all.
I am using loadMovieNum (level_01) to load the external .swf into.
The loaded .swf is one frame.
Any suggestions? advice? would be awesome. Thanks in advance.
ryan
Conflicting Movies
I have duplicated a movie of a dynamic text scroll from flash kit which is used twice in my main movie the trouble is the second scroller doesnt work. I think the tell target or some of the actionscript is conflicting but am not really sure what to do. I did try changing the names in the script but when I publish the movie the targets could not be found. can anyone help?
Scrollers Conflicting?
I have duplicated a movie clip of a dynamic text scroll and edited in new text for the second scroller so there are two scroller movie clips in my main movie, the trouble is only one scroller works. I think the tell target or some of the actionscript is conflicting but am not really sure what to change. I did try changing the names in the script but when I publish the movie the targets cannot be found. can anyone help?
here is some of the main action script I am using for the scroller, maybe someone could point out what script I should change for the second scroller:
frame 1:
top = "-136";
scrolllength = "60";
speed = "10";
bottom = Number(top)+Number(scrolllength);
amount = "0";
height = getProperty("text", _height);
originally = getProperty("text", _y);
.................................................. .................................................. ....
button logic movie:
if (Number((getProperty("../scrollhandle", _y)))>Number((Number(../:top)+Number((../:speed/(../:height/../:scrolllength)))))) {
setProperty ("../scrollhandle", _y, (getProperty("../scrollhandle", _y)-(../:speed/(../:height/../:scrolllength))));
} else {
setProperty ("../scrollhandle", _y, ../:top);
}
tellTarget ("../scrollhandle") {
gotoAndPlay (3);
}
.................................................. .................................................. ....
scroller movie
button:
on (press) {
tellTarget ("buttonlogic") {
gotoAndPlay ("up");
}
}
on (release, releaseOutside) {
tellTarget ("scrollhandle") {
gotoAndStop (1);
}
tellTarget ("buttonlogic") {
gotoAndStop ("stop");
}
}
.................................................. .................................................. ....
I noticed that the scrollers both work in a flash projector but not in a swf file
can anyone help?
Scrollers Are Conflicting
I have a problem that nobody seems to be able to solve or want to help me with. On my website in the biography section there are three scrollers under core skills, education and work experience. I duplicated the original scroller twice and edited in new text however only the original one works.
The scroller has been saved as a movie and also contains some small movies inside including the text so I suspect it is possible the script might be looking for a target with a different name.
can anyone point out if it is script I should change for the second and third scrollers or movie names within the main movie?
here is some of the main action script I am using for the scroller:
frame 1 of scroller movie:
top = "-136";
scrolllength = "60";
speed = "10";
bottom = Number(top)+Number(scrolllength);
amount = "0";
height = getProperty("text", _height);
originally = getProperty("text", _y);
.................................................. .................................................. ....
button logic movie:
if (Number((getProperty("../scrollhandle", _y)))>Number((Number(../:top)+Number((../:speed/(../:height/../:scrolllength)))))) {
setProperty ("../scrollhandle", _y, (getProperty("../scrollhandle", _y)-(../:speed/(../:height/../:scrolllength))));
} else {
setProperty ("../scrollhandle", _y, ../:top);
}
tellTarget ("../scrollhandle") {
gotoAndPlay (3);
}
.................................................. .................................................. ....
scroller movie
button (up):
on (press) {
tellTarget ("buttonlogic") {
gotoAndPlay ("up");
}
}
on (release, releaseOutside) {
tellTarget ("scrollhandle") {
gotoAndStop (1);
}
tellTarget ("buttonlogic") {
gotoAndStop ("stop");
}
}
this is most of the action script used in the scroller movie.
It should be enough to give you an idea of what I might be doing wrong.
thankyou!
Conflicting Preloaderscript?
Hi,
thank you for reading this.
I have a laoding bar and also a dynamic textfield for the percent in my preloader movie. The bar is supposed to get full when the movie is loaded. Is it a problem to have a dynamic textfiled that at the same time should go to 100 percent?
I have managed to mess up the preloading script. It goes like this:
totalBytes = _root.getBytesTotal();
loadedBytes = _root.getBytesLoaded();
percentDone = int((loadedBytes/totalBytes)*100);
bar.gotoAndStop(percentDone);
percent = Math.ceil(bytesloaded / totalBytes * 100) + "% loaded";
ifFrameLoaded ("Scene 1", 1) {
gotoAndStop("Scene 1", 1);
}
Could someone please help me and tell me what is wrong with the script? I am using MX.
Thanx for any answers!
regards
ik.
Conflicting Events
OK here's the problem...
I have an interactive map application which has the image of the area on in an MC called _root.map. On this mc is onPress code to zoom in/out,etc...
Now I have a list to the side that lets the user turn different layers of info(hotels, parks, dining, etc.) on and off. This info is represented by dots that are dynamically attached to an empty movie clip inside map MC...so the path would be _root.map.emptyclip.dot.
So the problem arises when i try to add onPress functionality to this dot (to display a name,image, etc).
When I test the movie, the dot's onPress functions are ignored in favor of the map's onPress events..
Is thre any way to give the dot's onPress event precedence without moving the dots to the main timeline(since they have to move/zoom with the map)?? Should I be using swapDepths??
Thanks for any help.
Conflicting Timelines
Hi.
I'm trying to put together a picture gallery using one of Flask MX's templates. I have created 7 swf files with the templates, each with there own preloaders and from the main swf I have buttons that load the "galleries" in an emptymc. The problem I'm running into is that the nav buttons in the gallery that switch the pictures is controlling the main timeline. When I try to alter the mc_controller scripting in the gallery swf.. the swf doesn't work properly. When I try to place the external swf ( gallery ) on a different level from the main movie it doesn't work all all....
any help would be great.
I've enclosed the gallery scene fla and the external fla gallery car show.
Thx
Galley Scene
Car Show Gallery
Conflicting Classes
I was getting the bug where classes weren't updating, so I download the ASO cache commands extension. I ran that, and now I'm getting error messages telling me that classes are confliting with themselves.
eg.
**Error** CharObj.as: Line 2: The name of this class, 'CharObj', conflicts with the name of another class that was loaded, 'CharObj'.
{
there is only one file, one class, but it's conflicting with itself?
Any ideas?
Conflicting AS Problem.
Essentially i'm trying to have a main timeline button trigger a MC's timeline to play frame 2-10, then stop on frame 12.
More indepth Explaination:
The main movie has 5 buttons on it (2 that trigger a menu called "RedBox", while the other 3 turn that menu off).
"RedBox" is a 13 frame MC, the first 10 frames are animation- frame "11" has info for button 1(Exhibits_mc), and "12" contain info for button 2 (Rentals_mc).
Frame 10, 11, and 12 of "RedBox" all have "Stop();" commands on them. Here is the script for the button that should link to frame 12:
code:
on(release) {
if (_root.RedBox._currentframe < "10") {
_root.RedBox.gotoAndPlay(2);
if(_root.RedBox_currentframe > "10"){
_root.RedBox.stop();
}else{
if(_root.RedBox._currentframe > "11"){
delete this.onEnterFrame;
}
}
}
}
The "GotoAndStops" don't seem to be stopping. And the "Stop();" commands on the "RedBox" timeline make the movie stop at frame "11" regardless of the script for some reason.
Here is an alternate version of the script i wrote that is pretty much having the same problem:
code:
on(release) {
if (_root.RedBox._currentframe < "10") {
_root.RedBox.gotoAndPlay("2");
} else {
if(_root.RedBox._currentframe = "12"){
_root.RedBox.gotoAndstop("12");
}else{
if(_root.RedBox._currentframe = "11"){
_root.RedBox.gotoAndStop("12");
}
}
}
}
I apologize for the sloppy code. Any suggestions?
Conflicting Function, Help Pls
I have this code, its so i can press either button on my stage and it will goto the frame number, load the external swf and play the corrent keyframe within the .swf file. It works fine but the preloader doesnt disappear once its loaded .
Quote:
var loaderino:Boolean = false;
function loadExternal(){
if(!_root.loaderino){
var loader:MovieClipLoader = new MovieClipLoader();
var listen:Object = new Object();
listen.onLoadInit = function(){
_root.loaderino = true;
_root.holder.switchSubSection();
}
loader.addListener(listen);
listen.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
var loaded:Number = Math.round((bytesLoaded/bytesTotal) * 100);
progressBar.gotoAndStop(loaded);
}
loader.loadClip("portfolio.swf", _root.holder);
}else{
_root.holder.switchSubSection();
}
}
about.onRelease =
function(){
gotoAndStop(8);
_root.subSection = "webs3";
_root.loadExternal();
}
profile.onRelease = function(){
gotoAndStop(10);
_root.subSection = "webs2";
_root.loadExternal();
}
the problem is this doesnt make the preloader disappear once it has loaded, the only way i know of trying to make the preloader vanish after its loaded is this..
Quote:
var loaderino:Boolean = false;
function loadExternal(){
if(!_root.loaderino){
var loader:MovieClipLoader = new MovieClipLoader();
var listen:Object = new Object();
listen.onLoadInit = function(){
_root.loaderino = true;
_root.holder.switchSubSection();
}
loader.addListener(listen);
listen.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
var loaded:Number = Math.round((bytesLoaded/bytesTotal) * 100);
progressBar.gotoAndStop(loaded);
}
listen.onLoadInit = function (target_mc:MovieClip) {
progressBar._visible = false;
}
listen.onLoadStart = function (target_mc:MovieClip) {
progressBar._visible = true;
}
loader.loadClip("portfolio.swf", _root.holder);
}else{
_root.holder.switchSubSection();
}
about.onRelease =
function(){
gotoAndStop(8);
_root.subSection = "webs3";
_root.loadExternal();
}
profile.onRelease = function(){
gotoAndStop(10);
_root.subSection = "webs2";
_root.loadExternal();
}
}
the problem with this is that it doesnt play the corrent keyframe in the external swf file, and i THINK its because of the function code bit! could anyone help me with making the preloader disappear once its loaded and make it play the corrent keyframe? sorry its so long! lol
Conflicting RemoveChilds
This is a stripped down version of my code, but with btn1 I'm loading a swf. btn2 and btn3 replace it with different things. It all works great as long as I don't click 2 or 3 if the swf is already gone. Then I get the error:
TypeError: Error #2007: Parameter child must be non-null.
I'm not sure how I should write this.
PHP Code:
function btn1_CLICK(evt:MouseEvent):void {
var caseURL:URLRequest = new URLRequest("caseStudies.swf");
var cs:Loader = new Loader();
cs.load(caseURL);
addChild(cs);
cs.name = "case";
}
function btn2_CLICK(evt:MouseEvent):void {
removeChild(getChildByName("case"));
}
function btn3_CLICK(evt:MouseEvent):void {
removeChild(getChildByName("case"));
}
Conflicting Code
Hi
I have one layer 'actions' and in the first frame i have a really simple code to load external images:
Code:
this.createEmptyMovieClip ("container_mc",this.getNextHighestDepth());
container_mc.loadMovie("images/0.jpg");
I have been using this code to scale images on the stage before and it works great, however i dont know how to use it with the loading external images code.
Code:
Stage.align = "TL";
Stage.scaleMode = "noScale";
container_mcHeight = new Object ();
container_mcHeight = container_mc._height / pic._width;
container_mcWidth = new Object ();
container_mcWidth = container_mc._width / container_mc._height;
if ((Stage.height / Stage.width) < container_mcHeight) {
container_mc._width = Stage.width;
container_mc._height = container_mcHeight * container_mc._width;
} else {
container_mc._height = Stage.height;
container_mc._width = container_mcWidth * container_mc._height;
};
container_mc._x = Stage.width / 2;
container_mc._y = Stage.height / 2;
sizeListener = new Object();
sizeListener.onResize = function() {
if ((Stage.height / Stage.width) < container_mcHeight) {
container_mc._width = Stage.width;
container_mc._height = container_mcHeight * container_mc._width;
} else {
container_mc._height = Stage.height;
container_mc._width = container_mcWidth * container_mc._height;
};
container_mc._x = Stage.width / 2;
container_mc._y = Stage.height / 2;
}
Stage.addListener(sizeListener);
Conflicting AS3 Buttons
Newbie here! Firstly, happy new year.
I'm trying to control three buttons. But all they do is animate together with the mouseover and don't go anywhere when clicked. This is currently where I'm at:
http://www.stu-artdesign.co.uk/thesolution/home.html
What I need to happen is when 'Vision' is clicked it goes to frame 2, plays and stops at frame 11, when the cross (button) that appears in the top corner of the text popup box (appears frame 12), you click that and it goes to frame 13, plays, then when it's frame 22, it sends it back to frame 1 and stops - i miss 'gotoandplay' in AS2!
This is my current code:
stop();
visionBtn.buttonMode = true;
visionBtn.addEventListener(MouseEvent.ROLL_OVER,an imIn);
visionBtn.addEventListener(MouseEvent.ROLL_OUT,ani mOut);
function animIn(event:MouseEvent):void {
visionBtn.gotoAndPlay(5);
contactBtn.gotoAndPlay(5);
joinBtn.gotoAndPlay(5);
}
function animOut(event:MouseEvent):void{
visionBtn.gotoAndPlay(20);
contactBtn.gotoAndPlay(20);
joinBtn.gotoAndPlay(20);
}
visionBtn.addEventListener(MouseEvent.CLICK, clickFunction);
function clickFunction(evt:MouseEvent):void {
visionBtn.gotoAndPlay(2);
contactBtn.gotoAndPlay(44);
joinBtn.gotoAndPlay(23);
}
contactBtn.buttonMode = true;
contactBtn.addEventListener(MouseEvent.ROLL_OVER,a nimIn);
contactBtn.addEventListener(MouseEvent.ROLL_OUT,an imOut);
contactBtn.addEventListener(MouseEvent.CLICK, clickFunction);
joinBtn.buttonMode = true;
joinBtn.addEventListener(MouseEvent.ROLL_OVER,anim In);
joinBtn.addEventListener(MouseEvent.ROLL_OUT,animO ut);
joinBtn.addEventListener(MouseEvent.CLICK, clickFunction);
Any help would really grateful, this i'm sure is quite basic (in AS2), but I'm really struggling with it :-(
Thank you in advance for any help/advice
Conflicting Scripts?
Hi all,
I have a mc with three nested mcs named as followed
clock_mc
clock138_mc
clock195_mc
each mc has the following script in their own timeline
//---------------sets first 360 degree rotation mask---------------------------//
//sets which mc is used as mask
_root.contents_mc.eff1_mc3.clock_mc.square_mc2.set Mask(_root.contents_mc.eff1_mc3.clock_mc.mask);
var i:Number=1;
var counter:Number = 0;
//sets wipe_mc as fill
function wipeCircle():Void{
var clip = _root.contents_mc.eff1_mc3.clock_mc.mask.wipe_mc.d uplicateMovieClip("circle"+i,i);
//sets the rotation of wipe_mc
clip._rotation = i++;
if( i > 360) clearInterval(circleWiper);
}
circleWiper = setInterval(wipeCircle,1);
//---------------sets rotation of clockhand_mc---------------------------//
//sets rotation + degrees of rotation
var n:Number= 1;
var counterR:Number = 0
function rotate():Void {
var clipR = _root.contents_mc.eff1_mc3.clock_mc.clockhand_mc;
clipR._rotation = n++;
if(n > 360) clearInterval(rotatehand);
}
rotatehand = setInterval(rotate, 0);
---------------------------------------------------------------------------
I modified the var and function names, nested mcs names on each clock movieclip, just so there would not be a conflict when the swf file plays.
but when I play the swf on initial click the first mc "clock_mc" plays fine and the other two play fine. but if I click back to play "clock_mc" again, the clockhand_mc rotate function goes 360degrees plus another number of degrees then kicks back to the 360 degree mark and finishes playing fine.
any ideas what could be causing this?
is there a way of dumping the script in order to load the other scripts into the time line and only have one script running at a time???
any help would be very welcomed!
will
Conflicting Errors?
I apologize for my lack of knowledge, I'm trying to follow a tutorial to get a better idea of how actionscript works. I'm trying to get an object to move with the arrow keys.
I originally had the code pasted on frame one of the main timeline and got this error: Clip events are permitted only for movie clip instances. So okay, I guess I have to put it on the movie clip then, and a google search confirms this.
So I put the code on the movie clip and I get this error: Statement must appear within on/onClipEvent handler. I google this problem and find that I can fix it by putting the code on the main timeline... On this site alone I found three topics that say placing the code on the timeline and removing it from the movie clip will solve the problem, but that doesn't solve the problem for me, as I just get the first error. Thanks for any help, here's the script pasted directly from the tutorial:
Attach Code
1.
onClipEvent (enterFrame) {
2.
if (Key.isDown(Key.LEFT)) {
3.
_x--;
4.
}
5.
if (Key.isDown(Key.RIGHT)) {
6.
_x++;
7.
}
8.
if (Key.isDown(Key.UP)) {
9.
_y--;
10.
}
11.
if (Key.isDown(Key.DOWN)) {
12.
_y++;
13.
}
14.
}
Conflicting Variables
have a movie that shows a map of the UK, all my customers are represented as a small triangle(button symbol)
when a customer is clicked I loadvariables from an ASP page that queries a db only for that customer and show them on the next frame these are the customers name, address etc about 20 variables then the "showvaribles frame" has a close button which puts me back to the begining of the movie,works great
What happens when I chose another customer, will they variables conflict ie 2 sets of var1?
can i unload the variables? that would be best
can I use var1 to 10 on one customer and 100 to 110 on another ? thats gonna be messy
any help appriciated
Conflicting Hit Areas
I am trying to make a menu something like gucci.com but my problem is this: the hit area for my button within a movieclip is interfering with my hitarea for the sliding bars. maybe this is the wrong way to approach this. can anyone help me? below is AS i have so far...
var bar1x = -162;
var bar2x = -228;
var speed1 = 30; // speed of box 1
var speed2 = 60; // speed of box 2
var speed3 = 10; // speed of text coming in / out
var textAlpha = 0;
text._alpha = 0;
var motionInterval = setInterval(checkBars,10);
theHitArea.onRollOver = function() {
//text._x = 3;
//text._y = 15;
bar1x = -2;
bar2x = -2;
textAlpha = 100;
}
theHitArea.onRollOut = function() {
bar1x = -162;
bar2x = -228;
textAlpha = 0;
}
function checkBars() {
bar1._x += (bar1x-bar1._x)/speed1;
bar2._x += (bar2x-bar2._x)/speed2;
text._alpha += (textAlpha-text._alpha)/speed3;
}
stop();
Conflicting Codes
Hi All
I have two codes on my main page. One makes my juke box dragable and one controls my dragable slider. The problem is if i implement the juke box code it sends the slider code mental, I guess this is to do with the fact that both codes are using the startDrag function. Is there a way around this without losing the functionality of it?
This one to enable my juke box to be dragable...
var left:Number;
var top:Number;
var right:Number;
var base:Number;
onEnterFrame=function(){
left=player_mc._x;
top=player_mc._y;
right=player_mc._x+215;
base=player_mc._y+60;
if ((_xmouse>left)&&(_xmouse<right)&&(_ymouse>top)&&( _ymouse<base)){
player_mc._alpha=100;
}else{
player_mc._alpha=70;
}
};
player_mc.move_btn.onPress=function(){
startDrag(_root.player_mc);
};
player_mc.move_btn.onRelease=function(){
stopDrag();
};
And this one is for my text pages to have a dragable slider
fscommand("allowscale", "false");
bar.useHandCursor = dragger.useHandCursor=false;
space = 20;
friction = 0.9;
speed = 4;
y = dragger._y;
top = main._y;
bottom = main._y+mask_mc._height-main._height-space;
dragger.onPress = function() {
drag = true;
this.startDrag(false, this._x, this._parent.y, this._x, this._parent.y+this._parent.bar._height-this._height);
dragger.scrollEase();
};
dragger.onMouseUp = function() {
this.stopDrag();
drag = false;
};
bar.onPress = function() {
drag = true;
if (this._parent._ymouse>this._y+this._height-this._parent.dragger._height) {
this._parent.dragger._y = this._parent._ymouse;
this._parent.dragger._y = this._y+this._height-this._parent.dragger._height;
} else {
this._parent.dragger._y = this._parent._ymouse;
}
dragger.scrollEase();
};
bar.onMouseUp = function() {
drag = false;
};
moveDragger = function (d) {
if ((dragger._y>=y+bar._height-dragger._height && d == 1) || (dragger._y<=y && d == -1)) {
clearInterval(myInterval);
} else {
dragger._y += d;
dragger.scrollEase();
updateAfterEvent();
}
};
up_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, -1);
};
down_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, 1);
};
up_btn.onMouseUp = down_btn.onMouseUp=function () {
clearInterval(myInterval);
};
MovieClip.prototype.scrollEase = function() {
this.onEnterFrame = function() {
if (Math.abs(dy) == 0 && drag == false) {
delete this.onEnterFrame;
}
r = (this._y-y)/(bar._height-this._height);
dy = Math.round((((top-(top-bottom)*r)-main._y)/speed)*friction);
main._y += dy;
};
};
Conflicting Dimensions
Hi-
I haven't been able to find this. Any help would be much appreciated.
I'm fixing existing fla files in which the stage dimensions are one thing (in this case 755 x 575), and the dimensions reported by objects on the stage seem to be another.
It shows up when I edit a movie clip that occupies about 650 pixels of stage width, but shows a propreties width of 389.9.
If I draw a rectangle nearly the full width of the stage while this movie clip is selected, and the rulers will show it to be, say, 650 pixels, but the properties panels report it to be about half that. Same for anything else on the stage.
The properties panel doesn't show any scaling percentage...
Thanks much for all any input. -David
Conflicting Vars
I have this script in a mc which is actioned by an invisible buttons rollover/rollout -
var dir="open"
var speed=2;
var totwidth=55
var width=55
var height=23.5
MovieClip.prototype.drawBox=function(x,y,w,h,fillCol,fillAlpha){
this.moveTo(x,y);
this.lineStyle();
this.beginFill(fillCol,fillAlpha);
this.lineTo(x+w,y);
this.lineTo(x+w,y+h);
this.lineTo(x,y+h);
this.lineTo(x,y);
this.endFill();
}
MovieClip.prototype.openDoor=function(){
if(dir=="open"){
var boxwidth = width;
}else{
var boxwidth = 0.5;
}
var boxheight = height;
this.onEnterFrame = function(){
this.clear();
if(dir=="close"){
if((width-boxwidth)>0.2){
boxwidth+=(width-boxwidth)/speed;
this.drawBox(0,0,boxwidth,boxheight,0x000000,25);
}else{
boxwidth=width;
this.drawBox(0,0,boxwidth,boxheight,0x000000,25);
delete this.onEnterFrame;
}
}else{
if((boxwidth)>0.2){
boxwidth/=speed;
this.drawBox(0,0,boxwidth,boxheight,0x000000,25);
}else{
boxwidth=1;
this.drawBox(0,0,boxwidth,boxheight,0x000000,25);
delete this.onEnterFrame;
}
}
}
}
this.onEnterFrame=(drawBox(0,0,width,height,0x000000,25));
the button has this AS -
on(rollOver){
dir="open";
openDoor();
}
on(rollOut){
dir="close";
opendoor();
}
the trouble is that if I put more than one instance on the stage, they effect each others workings! I know I shoud probably be using 'this' but I dont really know where or how etc.
Any help?
monkey
Tween Conflicting With
hey guys,
i'm having problems with getting a regular timeline animation to trigger after running a few actionscript tween commands on it. if i comment out the tweens then the animation triggers just fine. i'm using lmc_tween.as in this project so i don't know if there's some sort of limitation to it.
below is the code i'm using on a button that's referencing the movieclip "dud." once i rollover the button and causing it to tween, pressing the button won't trigger the gotoAndPlay command to work. if i comment out the rollover commands the gotoAndPlay works.
ActionScript Code:
on(rollOver) { dud.blackBox.tween("_x",200,1,lightEasingType,0);}on(rollOut) { dud.blackBox.tween("_x",40,1,lightEasingType,0);}on(release) { dud.gotoAndPlay("grey");}
sorry, if the two paragraphs above seem to repeat themselves...i sorta just realized it. long day at work so i'm kinda brain dead right now.
thanks!
-ray
Conflicting Classes?
I am just about to pull my hair out! Why do I constantly get this stupid error?
**Error** sectionClip.as: Line 1: The name of this class, 'sectionClip', conflicts with the name of another class that was loaded, 'sectionClip'.
I've tried deleting ASO files, I've tried restarting Flash, I've tried restarting my blessed computer and no luck.
Any suggestions before I go completely bald?
Thanks in advance for your support,
Jase
Conflicting OnRollovers
Is there a way to layer MovieClip's that both have onRollover behaviors? I am doing a project where I have a menu slide out (onRollover) and slide out sub-menu items (on Rollover) of the main menu.
Can anyone help me with this?
Can this be done?
would I have to delete the onRollovers of the Main menu to get the sub menu's to have a working OnRollover?
Please Help!
Conflicting Functions?
Hi,
I'm using 2 functions in my movie, one positions the MC and the other one resizes it. Both functions would work independently, however, when used together, only the Resize function works. Please help!
ActionScript Code:
//Reposition/////
MovieClip.prototype.myTweener = function() {
var elapsed = getTimer()-this.startTime;
var ratio = elapsed/this.timeRange;
if (ratio>1) {
this._x = this.endPos;
this.onEnterFrame = undefined;
return;
}
ratio = ratio*ratio*(3-2*ratio);
this._x = this.startPos+this.moveRange*ratio;
};
MovieClip.prototype.setupTween = function(seconds, endPos) {
this.startTime = getTimer();
this.timeRange = seconds*1000;
this.startPos = this._x;
this.endPos = endPos;
this.moveRange = this.endPos-this.startPos;
this.onEnterFrame = this.myTweener;
};
//Resize
MovieClip.prototype.Resize = function(w, h) {
this.t = 0;
this.duration = 20;
this.startw = this._width;
this.endw = w-this.startw;
this.starth = this._height;
this.endh = h-this.starth;
this.onEnterFrame = function() {
if (this.t<this.duration) {
this._width = easeInOut(this.t, this.startw, this.endw, this.duration);
this._height = easeInOut(this.t, this.starth, this.endh, this.duration);
this.t++;
} else {
delete this.onEnterFrame;
}
};
};
function easeInOut(t, b, c, d) {
/*Ease equation By Robert Penner*/
if ((t /= d/2)<1) {
return c/2*t*t+b;
}
return -c/2*((--t)*(t-2)-1)+b;
}
Thanks in advance,
Al
Sound Conflicting
I have three pieces of music that are attached to the linkage box. When a user clicks music number one, it plays, and when they click on it again it plays again over the previous one which sounds very hard and terrible. This is the code I am using,
Code:
on (release) {
sound.volumechanger.start( 0,1000 );
}
How can I make it not play if it's already playing
Conflicting If Statements
I dont really know how to explain this so I will put up a link to help explain it better:
http://www.members.optusnet.com.au/~srzich/tech.html
Ok, the slider uses the dragslidefade class which is shown in lee's tutorial by the same name.
Basically Im using the following code to make the movieclip with the content slide:
Code:
import com.dragslidefade.*;
//
// top y coordinate = 525;
// middle y coordinate = 75;
// bottom y coordinate = -365;
//
b_up.onRelease = function() {
if (this.slider._y = 75) {
var u1:Slide = new Slide(slider, 1);
u1.moveClipTo(185, 525, 5);
}
else if (this.slider._y = -356) {
var u2:Slide = new Slide(slider, 1);
u2.moveClipTo(185, 75, 5);
}
};
b_down.onRelease = function() {
if (this.slider._y = 75) {
var d1:Slide = new Slide(slider, 1);
d1.moveClipTo(185, -365, 5);
}
else if (this.slider._y = 525) {
var d2:Slide = new Slide(slider, 1);
d2.moveClipTo(185, 75, 5);
}
};
Now the sliding itself works fine, but after initally moving off the "Middle" state, it refuses to go back to it (it only reads the "else if" commands). Can anyone offer some advice on this?
Thanks guys, looking forward to hearing from you.[/code]
Flash MX, Conflicting Buttons?
This is one of my very first attempts at any types of Flash, I have been trying to work out the kinks for this website for quite a while but have been unsuccessful. I believe my problem is with conflicting buttons. If you see within the "navigation" layer, then within the "KAP" MC, this is where my problem originates. I will eventually have everything linked to other pages. Before I begin converting all the things such as "team", "movie", and "kap" into buttons to add the actionscript to link, the tween and rollover goes haywire. I have tried many things and am unable to find any way. PLEASE HELP! it will be deeply appreciated.
Old Games Conflicting With New Movie
I am creating a flash project for kids. I have included quizzes and video content and things like that, but when I came to including the games I had adapted from flashkit I encountered some problems. I am using MX 2004 and my movie uses Flash player 7 and Actionscript 2.0, the games I am trying to include were created with older versions of flash and I cant seem to get them to work when I bring them into my new movie.
I tried putting each game inside a movie clip then dragging it into my movie, but that doesnt seem to work. I have tried to copy the games into my movie layer by layer but this doesnt work either. Can anyone help? What is the best way around this problem?
Thanks in advance!
[MX] Conflicting Action Script?
hi can anyone help ive got two bits of action script which are conflicting with eachover these are:
-------------------------------------------
Lens.onEnterFrame = function() {
if (_root._xmouse>=0 && _root._xmouse<=300 && _root._ymouse>=0 && _root._ymouse<=300) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
};
-------------------------------------------
AND
-------------------------------------------
setProperty("largeobject", _x, (getProperty("/original", _x)-_x)*/:currentMag);
setProperty("largeobject", _y, (getProperty("/original", _y)-_y)*/:currentMag);
setProperty("largeobject", _xscale, /:currentMag*100);
setProperty("largeobject", _yscale, /:currentMag*100);
-------------------------------------------
How can i combind the two?
ps this my first post so sorry if you posted in the wrong place ;-)
[MX] Conflicting Action Script?
hi can anyone help ive got two bits of action script which are conflicting with each other these are:
-------------------------------------------
Lens.onEnterFrame = function() {
if (_root._xmouse>=0 && _root._xmouse<=300 && _root._ymouse>=0 && _root._ymouse<=300) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
};
-------------------------------------------
AND
-------------------------------------------
setProperty("largeobject", _x, (getProperty("/original", _x)-_x)*/:currentMag);
setProperty("largeobject", _y, (getProperty("/original", _y)-_y)*/:currentMag);
setProperty("largeobject", _xscale, /:currentMag*100);
setProperty("largeobject", _yscale, /:currentMag*100);
-------------------------------------------
How can i combind the two?
[cs3, AS2] Slideshow Has Conflicting Actions.
Hi i have a slideshow that changes slides every 8 sec but the user can also control it by selecting any one of the slides, skipping to the next or previous slide, or pausing the slideshow. Everything works fine except that when you pause the slideshow and select the next slide while it is paused the AS ceases to pause. I don't know how i would solve this but i need a way to let the AS retain its paused state even if the slide is changed.
Non-conflicting MC Instance Names
Hi guys,
I just wanted to ask how you all manage instance names when creating moviclips dynamically, say through a class that uses composition to instantiate MovieClips.
Here is what I came up with
ActionScript Code:
/*
*----------- Instance Manager ------------
*Return a new MC instance name least likely
*to conflict with others on the timeline
*m may contain MovieClips whose instance names may conflict
*with user defined instance names
*/
private static function nextInstanceName (m:MovieClip, n:String):String
{
var ct:Number = 0; //Define Counter
//Propogate Enumerable objects within the MovieClip
for (var i in m)
{
//type check
if (typeof m[i] == "movieclip")
{
ct++;//increment by one
}
}
return n + ct.toString();
}
Usage:
ActionScript Code:
this.createEmptyMovieClip("myMc", 0);
//store reference to each mc created in array
var mcRef:Array = new Array();
var mc:MovieClip;
//someObject has n properties
for (var i in someObject)
{
mc = myMc.createEmptyMovieClip(nextInstanceName(myMc, "string"), myMc.getNextHighestDepth());
mcRef.push(mc);
}
trace(mcRef)
Is there a better way to manage instance names when you are not sure when or if they may conflict with instances that may already exist within MC?
Sleeve
Loader Conflicting With Buttons
Hello,
I have a loader that is conflicting with the buttons I have created.
The loader and buttons overlap on one side and when I am rolled over that side of the button where the loader is supposed to display the image, the button goes nuts flickering. I tried to addChildAt instead of addChild but that didn't work.
I hope that I am taking the correct approach to this.
Here's my code for the image loader
Code:
var loader:Loader = new Loader();
function _over(evt:MouseEvent):void {
//THUMBNAIL IMAGE OF ISSUE WHEN MOUSE OVER NUMBER OF ISSUE
var dataList2:XMLList = graphics.story_thumb.attribute("graphic_pointer");
var str:String = evt.target.name;
var mySlice = str.slice(-1);
var dataElement2:XML = dataList2[mySlice];
var request:URLRequest = new URLRequest(dataElement2);
loader.load(request);
addChild(loader);
loader.x=150;
}
Here is my code for the buttons
Code:
var tmpButton:MovieClip = new btn();
//set other properties here (x, y, etc)
tmpButton.x=307;
tmpButton.y=23.5+(20*i);
tmpButton.buttonMode = true;
tmpButton.name = "myButton"+i;
//add the event listeners
tmpButton.addEventListener(MouseEvent.MOUSE_OVER, _over);
this.addChild(tmpButton);
Thanks
Tara
RollOver Conflicting With DragOver?
I'll admit that I'm a scripting novice. So I'm having trouble with some onRollOver, onRollOut, and onDragOver in some code of mine. It's an XML driven menu I borrowed from a tutorial. It allows you to drag items into any order.
Anyway, I've tried to implement a movieClip that is visible when you RollOver as well as a seperate movieClip that is visible onPress and onDrag. The code may be too ambiguous but maybe not. I'm at my wits end. Starting to thrash code around.
What I'm aiming for is movieClip that appears when you rollOver and goes away when you rollOut. And a movieClip that stays visible when you hold and drag the item around.
Any suggestions on this code below? Thanks in advance
ActionScript Code:
//Highlighting
song_mc.onRollOver = function(){
this.highlight_mc._visible = true;
}
song_mc.onRollOut = function(){
this.highlight_mc._visible = false;
}
//Pressing
song_mc.select_btn.onPress = function() {
this._parent.onMouseMove = function() {
if (!this.moved) {
dragline_mc._visible = true;
dragline_mc.play();
this.moved = true;
}
}
}
//Dragging
song_mc.select_btn.onDragOver = function(){
dragline_mc._y = playlist_mc._y + this._parent._y;
}
Flash Conflicting With Quicktime
(on PC) When trying to watch video on abc.com and nbc.com I am getting the quicktime Q logo with a ? mark in it... I think these are flash files and the only way to get these files to play I have to uninstall Quicktime. Driving me crazy cuz I make sure quicktime is only associated with quicktime files (I think) but still get these damn Q?'s
Anyone get this problem? Know the fic
Conflicting Class Names
I've been seeing an error a lot recently:
The name of this class, 'MyClassName', conflicts with the name of another class that was loaded, 'MyClassName'.
I'm not sure why I keep getting this error, especially with projects that only have one custom class. The only way I have been able to get around it is to continually rename the class.
Conflicting Timeline Problem
I have one swf called main.swf which has a container movieclip that gets external swf's loaded into it.
my external swf is called hosting and it calls an array of data that is loaded into a movieclip that is duplicate for each element from the database. The elements from the database are as follows:
Business
Economy
Power
Standard
Each one of these has a button over it that when press loads information from the database into a movieclip that contains a textbox. My button code is:
_root.movieclip.loadVariables("url to database");
This works flawlessly when I run the hosting.swf by itself, but when it is loaded into the contianer in the main.swf the buttons dont work.
I believe that it is the _root in the button call that is causing this but I dont know how to fix it. I think the _root variable changes when hosting is loaded into the main.swf.
Can someone help me please.
DuplicateMovieClip Depths Conflicting
Didnt pay much attention to depths until recently when diffrent mcs began to dissappear. I have several duplicateMovieClip commands, and usually set the depth to i the counter. However this causes problems
Is there a reccomended way of assigning depths to movieclips, I changed it to i + 10 and i + 50 as a temporary fix but can see conflicting occouring.
e.g
Code:
month_mc.duplicateMovieClip("month_mc"+i,i+10);
Any help or idea appreciated
thx
Conflicting Frame Rates
I have a movie (where it has 15 fps) that houses a movie (that has 30 fps).
When I load the 30 fps movie into the 15 fps it plays at 15 fps. Is there a way to separate these so they each play at their respective rates or does the movie that houses the others always take precedence?
AddListener Conflicting With TabIndex
Hello all.
I've built a simple form. I set the tabindex accordingly, it worked fine.
But during testing some people suggested that I write a few replacements to automatically remove junk characters from the telephone field. I did so with an event listener (the code below). But once I put it in, the user has to tab twice to get their cursor to navigate from one textbox to another. I know this is the problem because when I take out the following code, the tabindexing works just fine (one click to navigate).
Is there a better way of doing this so I can avoid the "conflict"?
Many thanks.
Code:
/* INITIALIZE AN EVENT LISTENER */
var key_listener:Object=new Object();
/* ASSIGN THE EVENT LISTENER TO A FUNCTION */
key_listener.onKeyDown=function() {
/* MAKE SOME CHANGES */
with(form_move_mc.form_mc) {
/* MAKE SOME REPLACEMENTS */
txt_telephone.txt.text=txt_telephone.txt.text.replace("-","");
txt_telephone.txt.text=txt_telephone.txt.text.replace(".","");
txt_telephone.txt.text=txt_telephone.txt.text.replace(" ","");
txt_telephone.txt.text=txt_telephone.txt.text.replace("(","");
txt_telephone.txt.text=txt_telephone.txt.text.replace(")","");
}
}
/* INSTANTIATE THE EVENT LISTENER */
Key.addListener(key_listener);
RollOver Conflicting With DragOver?
I'll admit that I'm a scripting novice. So I'm having trouble with some onRollOver, onRollOut, and onDragOver in some code of mine. It's an XML driven menu I borrowed from a tutorial. It allows you to drag items into any order.
Anyway, I've tried to implement a movieClip that is visible when you RollOver as well as a seperate movieClip that is visible onPress and onDrag. The code may be too ambiguous but maybe not. I'm at my wits end. Starting to thrash code around.
What I'm aiming for is movieClip that appears when you rollOver and goes away when you rollOut. And a movieClip that stays visible when you hold and drag the item around.
Any suggestions on this code below? Thanks in advance
Code:
//Highlighting
song_mc.onRollOver = function(){
this.highlight_mc._visible = true;
}
song_mc.onRollOut = function(){
this.highlight_mc._visible = false;
}
//Pressing
song_mc.select_btn.onPress = function() {
this._parent.onMouseMove = function() {
if (!this.moved) {
dragline_mc._visible = true;
dragline_mc.play();
this.moved = true;
}
}
}
//Dragging
song_mc.select_btn.onDragOver = function(){
dragline_mc._y = playlist_mc._y + this._parent._y;
}
|