OnMouseWheel And Scaling Performance
Hi therei've a mc containing a bitmap (Dim. aprox 1500 x 1000) and the onMouseWheel event linked to this mc :it's a thing likeMouse.onMouseWheel = function(delta){ if ( checkthatthemouseisoverthemaskedarea ){ this._xscale += delta; this._yscale += delta; }}... this bitmap is draggable, with a masked area, so the user can drag the bitmap around and zoom in and out.After i zoomed in and out the image for like, 8 times or few more, i noticed that the movie started to run really slow .... it seemed like there on every zoom was created some more task in background ....The onMouseWheel function does nothing but zooming the image, it doesn't fire other functions ....Any suggestion ?
Adobe > ActionScript 1 and 2
Posted on: 01/26/2007 06:59:18 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
OnMouseWheel
hi,
how to prevent? in the code above (mc) links, to scroll more than is _hight.
if (by any chance == you understand my bad english) {
please help me;}
//thanks a lot
Code:
var mouseListener:Object = new Object);
mouseListener.onMouseWheel = function(delta) {
links._y += delta;dragger._y -= delta;
OnMouseWheel On Mac
Does the event onMouseWheel exist on mac??
I try this code in windows XP and it work fine, but it doesn't work on mac.
stop();
function onMouseWheel(delta:Number, scrollTarget:String)
{
trace("onMouseWheel");
}
Mouse.addListener(this);
Is there a way of making it work??
Onmousewheel
is onMouseWheel only available as a listener or is there another way i can access it?
for example, if i wanted a given clip to have the code (graphical instance):
Code:
on(mouseWheel){ //do something here };
would i be able to?
usually there's a matching identifier function for this sort of thing...
like
Code:
on(press){ //do something here };
thanks!
f_y
OnMouseWheel (sorry =P)
Here's the deal. I'm using the onMouseWheel function to scroll the content which is all held in 'clip_mc' on my page. BUT, I'd also like to have this content easing out of it's motion if that's at all possible.
What could be added to the following or to clip_mc to do this?
mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
clip_mc._y += delta;
}
Mouse.addListener(mouseListener);
I've mined for information through google and various forums for the last two days, but I can't seem to hit what I'm looking for. All I'm finding is topics on what problems onMouseWheel creates. Any help would be greatly appreciated.
And please, go easy on me. I'm new in the game. :]
OnMouseWheel?
Hi,
I seem to be having a small problem with the "onMouseWheel" handler.
When tested in Flash: works perfectly.
When tested in IE, after publish: works, but only if my mousepointer is inside the movieclip that is supposed to be doing something.
When tested in FireFox / Flock: it doesn't do anything.
The code I used is:
ActionScript Code:
var root:MovieClip = this; var mList:Object = new Object();mList.onMouseWheel = function(delta:Number) { root.graph_mc._rotation += delta * 5; root.graph_mc.delta_txt.text = delta;}Mouse.addListener(mList);
A very basic adding-a-listener-to-something-to-check-something situation, but aparently I'm missing something.
Thanks in advance
[AS] OnMouseWheel Bug
Ok Im full of finding stupid bugs in the last two days. Here is another one that someone might be able to answer for me.
This file, contains a simple onMouseWheel script that moves a movie clip around in the X axis.
What I have noticed when trying to incorporate this into other more useful scripts (say a scrollbar), is that it tends to double the "delta" if the script is loaded more than one time.
I guess the easiest way to show you is to use the file I attached above. Load the FLA into flash and run a preview. Notice how much the square moves when the mousewheel is scrolled (it should move its width each click).
Now CTRL-ENTER again without exiting the preview. Notice how the scrolling is off? Preview it again, and the problem is even more compounded. Preview it a few more times and there is a huge jump for each mouse wheel click.
Anyone know why this is? Or how can I fix it?
Thanks
Mike
OnMouseWheel Go To Frame?
Hi all, I'm wondering if there is a way to make the onMouseWheel event go to a frame like you can with onKeypress? Any assistance would be great, thanks.
Im using onKeypress to navigate between frames with the keyboard arrows, but I would like to also be able to use the MouseWheel.
on (keyPress "<right>") {
//Movieclip GotoAndStop Behavior
this.gotoAndStop("2");
//End Behavior
}
on (keyPress "<left>") {
//Movieclip GotoAndStop Behavior
this.gotoAndStop("1");
//End Behavior
}
Here is an example of onMouseWheel. I've tried modifying it, but don't really know what to do and have had no luck.
var mouseListener:Object = new Object();
mouseListener.onMouseWheel = function(delta) {
clip_mc._x += delta;
}
Mouse.addListener(mouseListener);
OnMouseWheel Problem
Hi all,
I have a scrolling dynamic text, and I made it support mouse wheel also.
The scrolling text is part of a movie that loads externally (on _level2).
I am making a site with the main menu on a level, and the other pages load on _level2 (so all pages are loaded externally, including the page with the scroller). I am saying this because my problem occurs when I visit another page (load another page on _level2), and then I come back to the page that contains the scroller (load the scroller movie on _level2) the mouse wheel works wird, meaning it scrolls more than it did last time.
So the first time you visit the scrolling text page, the mouse wheel scrolls about 20 pixels with every scroll, if I press a button to visit another page and then come back, the mouse wheel will scroll about 60 pixels with every scroll, and so on. The distance keeps increasing, only if I go to another page and then come back. Weird ain't it?
Here is the code (the onMouseWheel code is at the end)
PHP Code:
import mx.transitions.*;
import mx.transitions.easing.*;
var First=_level3.loadXMLS[_level3.firstMovie]
var _css = new TextField.StyleSheet();
function loadXML(loaded) {
if (loaded) {
_root.info = this.firstChild.childNodes[0].firstChild.nodeValue;
_root.heights = this.firstChild.childNodes[1].firstChild.nodeValue;
_css.load("colors.css");
_css.onLoad = function(){
main.scroller.styleSheet = _css
pageTitles.styleSheet = _css
_level3.preloader_mc.stop ()
_level3.preloader_mc._visible = false
TransitionManager.start(_root.content_mc, {type:Wipe, direction:Transition.IN, duration:1, easing:Strong.easeOut, startPoint:6});
};
main.scroller.htmlText = _root.info
main.scroller.html = true
main.scroller.styleSheet = _css
main.scroller.autoSize = "left";
main.scroller.text = _root.info;
if(main.scroller._height < mask_mc._height){
up_btn._visible = false;
dragger._visible = false;
bar._visible = false;
down_btn._visible = false;
}
bottom = /*(main._y+mask_mc._height-main._height)*/ - _root.heights
} else {
content = "Error Loading File";
}
}
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = loadXML;
if (First != undefined) {
myXML.load(First)
} else{
Txt.text="No Xml file specified yet.."
}
//LOADING THE XML FROM THE main_menu.xml
var File=_level3.loadXMLS[_level3.currentMovie]
///////////////////////////////////////////////////////////
if (File != undefined) {
myXML.load(File)
} else{
Txt.text="yoyo"
}
///////////////////////////////////////////////////////////
stop();
space = 0;
friction = 0.9;
speed = 4;
y = dragger._y;
top = main._y;
bottom = (main._y+mask_mc._height-main._height-space) - _root.heights
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, 20, -1);
};
down_btn.onPress = function() {
myInterval = setInterval(moveDragger, 20, 1);
};
up_btn.onMouseUp = down_btn.onMouseUp=function () {
clearInterval(myInterval);
};
up_btn.onRollOver = function() {
this.gotoAndPlay("over");
};
up_btn.onRollOut = function() {
this.gotoAndPlay("out");
};
down_btn.onRollOver = up_btn.onRollOver;
down_btn.onRollOut = up_btn.onRollOut;
up_btn.onPress = function() {
myInterval = setInterval(moveDragger, 20, -1);
};
down_btn.onPress = function() {
myInterval = setInterval(moveDragger, 20, 1);
};
up_btn.onReleaseOutside = function() {
this.gotoAndPlay("out");
}
down_btn.onReleaseOutside = function() {
this.gotoAndPlay("out");
}
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;
};
};
dragger.originY = dragger._y;
dragger.originX = dragger._x;
scrollSpeed = 5
//cosa=main.scroller._height/bar._height
var mouseListener:Object = new Object();
mouseListener.onMouseWheel = function(delta) {
if(main.scroller._height < mask_mc._height){
trace("hihi")
}else{
dragger.scrollEase()
}
if (dragger._y>=dragger.originY) {
dragger._y -= delta*scrollSpeed
if (dragger._y<dragger.originY) {
dragger._y = dragger.originY;
} else if (dragger._y>dragger.originY+bar._height-dragger._height) {
dragger._y = dragger.originY+bar._height-dragger._height;
}
}
};
Mouse.addListener(mouseListener);
Does anybody have any ideas on how to fix this?
Thank you so much
Detect OnMouseWheel
I've added a feature to check if my mousewheel is moving for my inertia scroller however i am trying to prevet the scroller from moving if
1. It's not necessary or
2. It's at the top of the page.
Code:
var mouseListener = new Object();
mouseListener.onMouseWheel = function(wheelMotion) {
if ((dragger._y>=y+bar._height-dragger._height && wheelMotion == 1) || (dragger._y<=y && wheelMotion == -1)) {
stop();
} else {
dragger._y -= wheelMotion*5;
dragger.scrollEase();
updateAfterEvent();
}
};
Mouse.addListener(mouseListener);
I'm pretty certain that the problem is "&& wheelMotion == 1" however I'm not sure what the value should be to check if the mouse is moving or not?
Andy help would be great.
Onmousewheel Isn't Captured
Hi all,
I'm working on a navigation system which use the mouse wheel as a mean to move through a 3d space. Anyway, the problem is that it seems that the mouse wheel isnt working until the flash is clicked at first. You can test this with this simple script on the first frame of a movie :
var ml:Object=new Object();
ml.onMouseWheel=function(delta){trace(delta)}
Mouse.addListener(ml);
It won't trace anything until you click on the stage. Is this a known bug, is there any workaroung ?
Thanks a lot,
rb
OnMouseWheel + Delta
Hey everyone,
In the MM documentation, they say the following:
Quote:
Usage
ActionScript Code:
<i>someListener</i>.onMouseWheel = function ( [ <i>delta</i> [, <i>scrollTarget</i> ] ] ) { // your statements here}
Parameters
delta An optional number indicating how many lines should be scrolled for each notch the user rolls the mouse wheel. A positive delta value indicates an upward scroll; a negative value indicates a downward scroll. Typical values are from 1 to 3; faster scrolling can produce larger values.
Yet, where would I actually specify a value for delta?
If I specified a positive value for delta within the onMouseWheel function, scrolling the mouse down did not automaticaly "negativitize" the delta to cause negative scrolling. But, if I never define delta and just use delta as part of my function, the value for it fluctuates between a negative and positve value depending on the direction I scroll the mouse.
Surely there must be a way to specify the magnitude of delta somewhere and let the mousescroll function specify a positive or negative value depending on the direction of the mouse scrolling.
Thanks!
Kirupa
OnMouseWheel Problem
Hi,
I have a simple function that traces the delta value of the onMouseWHeel function.
When I hit ctrl-enter all things work fine and I get the fowlling result:
trace: 3
But when I hit ctrl-enter again (downloade sim mode) I get twice the values, its like the function get called twice:
trace: 3
trace: 3
The problem now is that I use the onmouswWheel function to scroll some products (like www.thefwa.com) but when ever I reload the swf (going to another section and back) the scrolling function get messed up because I get double values instead of a single value.
Quick AS to test for your own:
ActionScript Code:
var mouseListener:Object = new Object();mouseListener.onMouseWheel = function(delta:Number) { trace("trace: "+delta);};Mouse.addListener(mouseListener);
OnMouseWheel DISABLED
Hi,
I would like to ask, if there exists any code, which would make a function disabled onMouseWheel?
Thank you for any help.
Zoom OnMouseWheel
Hi everyone,
I am working on a zooming file. I want to zoom using the mousewheel, does anybody can help me out with that please.
Thanks a lot for any help,
Jerome
OnMouseWheel Problem
Hi!
Ive found this code in the help docs of flash:
this.createEmptyMovieClip("line_mc", this.getNextHighestDepth());
line_mc.lineStyle(2, 0xFF0000, 100);
line_mc.moveTo(0, 100);
line_mc.lineTo(0, 0);
line_mc._x = 200;
line_mc._y = 200;
var mouseListener:Object = new Object();
mouseListener.onMouseWheel = function(delta:Number) {
line_mc._rotation += delta;
};
mouseListener.onMouseDown = function() {
trace("Down");
};
Mouse.addListener(mouseListener);
This is great, but what i need is, to be able to
give two numbers, in between the onMouseDonw functions,
and when the line_mc._rotation reaches one of the numbers it stops
Has Anyone Used The OnMouseWheel Function?
I think this should be a very easy question, especially since it is discussed in the AS dictionary. But something is not making sense to me, maybe someone could give me a good kick in the head and help me see what I am over looking.
AS 2.0 finally recognizes the mouse wheel. I pulled the code example directly from the help menu and drooped it in to my movie but I’m getting nothing. I guess the basics are a little over my head. Here is what the dictionary says
someListener.onMouseWheel = function ( [ delta [, scrollTarget ] ] ) { // your statements here
}
Example:
mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
clip_mc._y += delta;
}
Mouse.addListener(mouseListener);
should be simple. But embarrassingly enough I am all lost on it. Where do I stick this code? Dose it matter? I can not even get a trace(); action to register. Is it basically a function that I call from else where? How? I’m fuzzy on the scrollTarget as well.
Can some one explain this very very simply?
Thank you
OnMouseWheel Event Not Firing?
Hi everyone,
I'm a bit stumped by this one especially since I have not read similar posts in these forums. Essentially, the onMouseWheel event doesn't seem to work at all.
I've tried creating the listener on a clip, an object, and a class without any luck. I've tried numerous examples to see if there may be a tidbit I've been missing and they also don't work. Samples of onMouseWheel listeners online (SWFs demonstrating the outcome) also don't respond. I've also tried it under a variety of browsers as well as the standalone Flash player.
I wouldn't consider myself a noob when it comes to Flash; I've been a professional Actionscript developer for over 5 years now and I feel that I have a pretty good grasp on the language. I also work with two other talented developers who I think are tops when in comes to AS and Flash in general. They also can't get any onMouseWheel events going (yes, we're all working on PCs). I'm curious as to why I haven't been able to get this relatively simple listener going. I've tried it on my work and home computers with different copies of the Flash authoring environment. I've also tried to get the mouse wheel to work at friends homes as well as when I was up at my folks place and NO MOUSE WHEEL!
Is this a cruel joke of some sort? I can't believe that three AS developers working on three machines couldn't get it to work. I'm also stunned that trying it on roughly 5 different PCs of different makes and models with varying hardware/software also failed to produce any results. Simply put, I haven't seen the mouse whel listener working in Flash and I've been trying it on and off since MX.
Does anyone out there have an explanation of what may be going on? Am I cursed? Has anyone else encountered this problem? I am willing to try any and all suggestions you may have.
Many humble thanks,
Patrick
Lack Of .onMouseWheel Support On Mac OS X
Being a Flash developer since Flash 5/MX, I'm highly annoyed by the lack of support for the .onMouseWheel event in the Flash player for Mac.
This is not a rant, I'm just looking for answers.
For those not familiar with the .onMouseWheel event handler, it allows you to scroll text fields and even movieclips with a mouse scroll wheel. However, this is only supported in Windows.
Mac OS X, surely enough, is more than capable of supporting this. OS X supports scroll wheel mice, and with the release of the Mighty Mouse, scrolling via mouse will [finally] be standard. I'm quite disappointed that I cannot test this feature on my platform, and I do find it a hindrance to the progression and feature-set of my project.
There's an example of the .onMouseWheel event handler at http://www.communitymx.com/content/a....cfm?cid=E81CE
Does anyone have any insight on this?
I Made Scroller. But OnMouseWheel.
i made a scroller. and at first it works fine. but something happens when i use onMouseWheel. and here is the file. any suggestions. please help on this one.
PS: first click the white button. then use mouse scroller. then click yellow button and then use mouse scroller. you can see text is moving. my idea is if text has a small text it won't use mouse scroller.
OnMouseWheel Text Size
Hi,
i cant remember the site but when you used the mouse wheel it changed the size of font. it starts off as a pixel font then when scroll to get it bigger it changes the font and increcreases the size.. i think you could change it to 3 font sizes...
Does anyone know how this is done?
tys for any help
Stephen
OnMouseWheel Has To Click To Activate?
Hi guys,
I just found out that the onMouseWheel is really not working before you click on teh stage.
I tested on several site with onMouseWheel effect, all the same. Is that so? Is there a work around that? Kind of little buggy to me.
- mark
OnMouseWheel & Selection.setFocus
Hey guys, I've been trying to get an onMouseWheel event that I set up working for an onRollOver event, or something similar, like an onMouseMove combined with hitTest or something. So far, the onMouseWheel only works if the user presses the mouse button first. Then, after that, it'll work, but not until then. I'm wondering if it's possible to somehow set the focus dynamically based off a rollOver & rollOut.
Fernando was telling me earlier today about Selection.setFocus, and so far I can't seem to make it work, as well as can't get it to trace anything but null. I'd like to set up an MC to handle listen for the events, so if a user rolls over the MC's area, then it enables the mouseWheel, and if they roll off, it disables the mouseWheel.
Thanks in advance!
~James
OnMouseWheel + Math.round + Boundaries
Peepz,
I have a movieclip that has a height of 500 px, it starts on _y = 0, now i want to scroll it on integers with Math.round but it won't work. I also want it to stop scrolling down if he is at the bottom or the top (it behind a mask)
the tween method works fine so let it as it is...
hope somebody can help?
thanks already!
Code:
mover = 0
var mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
mover += Math.round(10*delta);
mcTempHolder.tween("_y", mover, 1);
};
Mouse.addListener(mouseListener);
OnMouseWheel + Math.round + Boundaries ?
Peepz,
I have a movieclip that has a height of 500 px, it starts on _y = 0, now i want to scroll it on integers with Math.round but it won't work. I also want it to stop scrolling down if he is at the bottom or the top (it behind a mask)
the tween method works fine so let it as it is...
hope somebody can help?
thanks already!
Code:
mover = 0
var mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
mover += Math.round(10*delta);
mcTempHolder.tween("_y", mover, 1);
};
Mouse.addListener(mouseListener);
OnMouseWheel Easing Bouncing Limits
ok, I stuck here with this easing mouse wheel thing. it all works fine so far with this.
ActionScript Code:
mouseListener = new Object();
mouseListener.onMouseWheel = function(amount) {
ymove = amount*30;
myMovieTargety -= ymove;
}
Mouse.addListener(mouseListener);
myMovie.onEnterFrame = function(){
speed = 4;
myMovieOldy = myMovie._y;
myMovie._y += (myMovieTargety - myMovieOldy)/speed;
}
Now I want to add a bouncing limit to the movie's y property, like when you are really scrolling an article, you get stuck when you reach teh bottom of the article, that way you can only scroll up.
what is the easy way to do that based on above code?
I am new to as 2.0
many thanks.
- mark
OnMouseWheel + Math.round + Boundaries ?
Peepz,
I have a movieclip that has a height of 500 px, it starts on _y = 0, now i want to scroll it on integers with Math.round but it won't work. I also want it to stop scrolling down if he is at the bottom or the top (it behind a mask)
the tween method works fine so let it as it is...
hope somebody can help?
thanks already!
Code:
mover = 0
var mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
mover += Math.round(10*delta);
mcTempHolder.tween("_y", mover, 1);
};
Mouse.addListener(mouseListener);
OnMouseWheel Only Fires After The User Has Clicked The Mouse Once
I have a basic onMouseWheel set up:
Mouse.addListener(clip_mc);
clip_mc.onMouseWheel=function()
{
trace("onMouseWeel fired");
}
In the real application it does a lot more than this of course, but this is the essential point to demonstrate the issue. I have noticed that if the user has not clicked the mouse, the mouse wheel event doesn't fire. If the user has clicked anywhere (not even on the listening clip) then the mouseWheel event will fire.
I have tried inserting:
clip_mc.onMouseDown();
clip_mc.onPress();
clip_mc.onRelease();
clip_mc.onMouseUp();
as a hacked effort to trick the mouse broadcaster into thinking a mouse click has occured but that doesn't work.
I just want to have it so my mouseWheel event will work without requiring the user to click their mouse once first. It isn't the end of the world, but it would really add that nice last touch of polish to my applicaiton if I could figure this litle guy out.
Full Screen Issues With Key.isDown And OnMouseWheel
This is really wierd... I have a photo slide show I'm developing and have run into a couple issues. At standard size (when viewing in a web page) the Key.isDown works just fine, but the onMouseWheel listener I have doesn't work. When I toggle to full screen, the onMouseWheel listener works fine (once the message about hitting ESC goes away) but it now ignores the Key.isDown feature.
This will be very frustrating for the viewer to only be able to use one or the other depending on how it's being viewed as both won't work in the same view.
Any ideas why this might be happening? I've been scouring many of the threads regarding the onMouseWheel and I'm thinking it has to do with the browser taking controll over the mouse wheel which is why that won't work unless full screen, but I have yet to find why the Key.isDown is not working in full screen view.
No Resize/scaling A Movie Clip On The Scaling Stage...
I know this has probably been answered here already, but I've search through all the threads with "scaling" and "resizing" and can't find the solution.
Basically I have a GUI element on a gallery that I don't want to scale, while the rest of the page is free to resize/scale.
I think I need to add a listener of some sort to the stage, but I'm not sure how to do this. If you can point me to a thread where this has already been answered, great! Otherwise I would be grateful for any help you could provide here.
Scaling Dynamic Textfield Without Scaling Font
the titel sys it...
if you create a dynamic textfield...you drag it but you can not see the prcise idth value...so lets say i have a field and the width is 198,5 and i want it to be 200...the problem is if you scale...the fonts also scale...any ideas...
[9-slice Scaling] Not Scaling At Correct Size ?
Hi people,
I found something strange with the 9-slice scaling option.
My MC with that option is simply smaller than the one without it !
You can see an example here (fla in attachement).
with the simple code on the green button :
Code:
on (release) {
_root.i += 10;
this.scroller._height = _root.i; // the left one with 9ss
this.bar._height = _root.i; // the right one without 9ss
}
Does someone have any explanation ?
thanks
Scaling Cursor/Scaling Draggable
Hello.
I am trying to create a draggable movie that will scale depending on it's _x and _y coordinates.
Basically, when the movie is on the lower part of the screen it will be larger than when it's on the top part of the screen.
I would like the scaling to be smooth. I can say, "if this clip is above 100, then reduce by 10%", but it looks poor.
Does anyone have a nicer way to achieve this draggable scaling?
Thanks.
Scaling/preloader..scaling To A Certain Size..
Hi gang...ok...I have a percentage preloader using getBytes.....and I have a preloader bar that increases dependant on the percentage of bytesloaded...what I want is to have the preloader bar scale so that when the percentage reaches 100% the loader bar will be a certain width.
Here is my code so far....please help me edit my exixsting code..and NOT start just re-write the whole thing..I am trying to learn..and incorporate.
Code:
//In Frame 1 I have this:
total = this.getBytesTotal();
//In frame 2 I have this:
_root.growbar._xscale = percent;
loaded = this.getBytesLoaded();
percent = Math.round((loaded/total)*100);
displayPercent = "LOADING: "+percent+"%";
if (percent == 100) {
gotoAndPlay (4);
}
//In frame 3 I have this:
gotoAndPlay (2);
//In frame 4 I have this:
gotoAndPlay ("start");
I made an MC with the name of "growbar" on the stage....
I cant figure ot what I am overlooking...
-whispers-
p.s. Nevermind..I feel like a fool....I found it..LOL
Non-scaling Object In Scaling Movie
Does anyone know - Is it possible to have an movie clip, that retains a fixed pixel size e.g. 200x100 inside a flash movie that scales to 100% to fit browser window?
Scaling Shapes Without Scaling Strokes
Hello, I am a new Flash user. I am creating a simple animation to be used in an educational video. I created a graphic symbol which I have tweened in many instances to fade in/out and to grow in size. This is a simple circle without a fill, starting out with a solid 5 pixel stroke. How can I grow this symbol (it ends up at least 4 times larger than its original size) without growing the stroke as well?
Scaling Vs. Non Scaling Of Loaded Clips
Hi there,
I am trying to achieve the loadmovie whereby my container flash movie (main.swf) is 100%x and 100%y scaled in the browser...ie so it's size is dynamic to the browser size (This is fine...know how to do)
But want to load the internal clip at exact dimensions - ie I guess a loadmovie in a target clip or level? with exact x and y size dimensions that always centres in the container flash clip. ie. its size is constant no matter the browser size.
Look at this site for reference.... http://www.beachblanket.co.uk/
Thank you for your help!
Josh
Full Scaling Site + Scaling MC's
I have been trying to figure out how to do this, because I think it looks fantastic. I know that there are a number of things you add to the stage in order to get it to sit aligned right in the middle. I have even manged to ease the stage movements so that when you maximise and minimise by adding friction and acceleration, the movement is smoother and cleaner.
It looks like whatever is loaded into the MC expands and contracts the parent MC, with a border. The movement is seamless and I was wondering if anyone knows how to achieve the same effect.
I have gotten pretty far with it too, but I am momentarily clueless as to this part.
check it out
http://www.nulldesign.de
Scaling And Not Scaling In One Movie
Hi!
I´m creating a movie in witch I want curtain ellements (vector images) to scale to 100% of
the users screen and other ellements (pixel images) to stay at a fixed size and position.
Take a look at the following site:
www.hi-res.net
When you scale the browser window, the background photo scales with it; it stays fullscreen.
However, the menu stays at its original size.
The effect is possible without using html layers (see source of www.hi-res.net). Anyone
knows how to make this work within 1 swf through actionscripting?
Thanks,
Jef
Achieve Scaling After Scaling
The situation:
I have a header frame that could possible be a 1024 pixels, 800 pixels, etc, etc in width depending on the users resolution. Now, I want my flash file to span accross this space 100% which can easily be done in flash/html.
The problem that I have is that I don’t want the height to change and I don’t want anything distorting inside the flash file itself as an image would. I would like the flash interface to scale in the same way html does.
If you left align something, I want it to be at the far left with no change in actual size.
I have seen this done before with scrolling panes but can’t seem to find information on it anymore.
Any help would be appreciated
Thank you for your time,
Ryan Tate
Non Scaling In Scaling Part
Hi All,
really sorry to bring this one up again. I've managed to create quite good working gallery, thanks to cello and scotty. What I'm trying to now is create a menu that is attached to the scaling part but does not scale it self - in other words just changes position. here's an example of what I mean: galleru #1
gracias for your help,
m.
Non Scaling In Scaling Part
Hi All,
really sorry to bring this one up again. I've managed to create quite good working gallery, thanks to cello and scotty. What I'm trying to now is create a menu that is attached to the scaling part but does not scale it self - in other words just changes position. here's an example of what I mean: galleru #1
gracias for your help,
m.
"onMouseDown" Working, Can't Get "onMouseWheel" To Work
I'm using AS2, I have a simple class in an external .as file. I have it extend MovieClip and I have a few functions that work great, such as "function onMouseDown()" and "function onMouseMove()".
Now I want to do the same with onMouseWheel. The only problem is that I can't get it to work without specifying in the constructor for the class "Mouse.addListener(this);" But this causes my other functions (such as the onMouseDown and onMouseUp) to register twice, so it sees every single click as a double click.
Is there something I am missing? Thanks for any help.
Performance
thanx to oldnewbie for the reply on my previous posting.
So, another question here. reading text from an external txt file is better or set all the variable directly inside the movie ( i mean set all the text to be displayed in the movie so dont have to load from an external file). Which one gives better performance?
Performance?
I have a performance problem. I hope somebody would have faced this kind of problem before. I have 2 flash movies main.swf and one.swf of sizes 50kb and 80kb. Both are working fine individually. But when I call one.swf from main.swf then both are becoming very slow. Can anybody explains what is happening and how to overcome this problem.
Performance
Just to clarify, I'm currently under the assumption that converting lines to fills knocks filesize up a little but allows shapes to be drawn faster and moved quicker at runtime.
Just checking if I'm correct here, because I'm trying to optimise stuff as much as I can.
Best Performance
Hello everybody! I'm not exactly a newbie, been doing flash for about a year, but I have never really created heavy applications like the game I am creating now.
I'm reeally interested in knowing which commands and scripts uses a lot of the procesor's power, and in which way a good flash programmer programs.
I've heard enterFrame is not good to use, but what about long loops and such? right now I have probably 5 loops going off at the same time when I fire a gun, how many of these can I add, or is there a better way of going about?
Any other information about what to use, and what not to use will be greatly appreciated!
/Tempesta
AS3 Vs AS2 Performance
Hello,
I did some performance tests in AS2 and AS3 and what I found is really surprising.
I just wrote the below code in AS3 and similar code in AS2. But I don't see *ANY* performance improvements in AS3 version. On a P4 3GHz HT, AS3 version takes 8% CPU and AS2 version also takes 7% CPU. No major difference.
So where is that 10x performance difference that people says for AS3/Flash Player 9.
Does this means that there is no difference in redrawing the screen in FP8 and FP9
AS3 Code:
Quote:
var toggleX:Boolean = true;
root.addEventListener(Event.ENTER_FRAME, EnterFrameHandler);
function EnterFrameHandler(myEvent:Event)
{
for (var i:uint = 1; i <= 24; i++)
{
if (toggleX)
root["Ball" + i].x += 5;
else
root["Ball" + i].x -= 5;
}
toggleX = !toggleX;
}
AS2 Code:
Quote:
var toggleX:Boolean = true;
_root.onEnterFrame = function()
{
for (var i:Number = 1; i <= 24; i++)
{
if (toggleX)
_root["Ball" + i]._x += 5;
else
_root["Ball" + i]._x -= 5;
}
toggleX = !toggleX;
}
AS3 Code:
Quote:
var toggleX:Boolean = true;
root.addEventListener(Event.ENTER_FRAME, EnterFrameHandler);
function EnterFrameHandler(myEvent:Event)
{
for (var i:uint = 1; i <= 24; i++)
{
if (toggleX)
root["Ball" + i].x += 5;
else
root["Ball" + i].x -= 5;
}
toggleX = !toggleX;
}
AS2 Code:
Quote:
var toggleX:Boolean = true;
_root.onEnterFrame = function()
{
for (var i:Number = 1; i <= 24; i++)
{
if (toggleX)
_root["Ball" + i]._x += 5;
else
_root["Ball" + i]._x -= 5;
}
toggleX = !toggleX;
}
Neeraj
|