Strange Behaviour Could Be Eventlistner?
hi All
I just built a website and unfortunately it's been acting a bit strange recently. It's got a carousel and then when you click on one of the links the carousel disapears and a new swf is loaded. The problem is that half the time the new swf only loads half way.
The strange thing is that this only seems to occur the first time someone clicks on a link. Thereafter the site works perfectly. It is also not consistent. Sometimes it will load a swf and other times not. Everytime however the preloader counts how many images are loaded. check out the url to see what i mean:
wouter.freespeechpub.co.za
I have two things linked to the eventlistner. On is a text field which gets updated to show the user how many images have been loaded and the other is a smoothing function written by some guy from adobe. Could the problem be here?
listener.onLoadInit = function(mc:MovieClip) {
mc._visible = false;
var bitmap:BitmapData = new BitmapData(mc._width,mc._height,true);
this.tmc.attachBitmap(bitmap,10000,"auto",true);
bitmap.draw(mc);
assetLoadCount++;
cover.imgTotal.text = (assetLoadCount+" of "+numOfItems);
// trace(assetLoadCount+" of "+numOfItems);
if (assetLoadCount == numOfItems)
{
cover._visible=false;
if(counting==0){
loadBitmapSmoothed(item0.imgLoad, projector.imgHolder);
bop=item0.imgLoad;
textDisc.htmlText=item0.discText; }
}
Here is the entire code for the swf:
Code:
import flash.display.*;
import com.mosesSupposes.fuse.*;
Fuse.AUTOCLEAR = true;
ZigoEngine.register(Fuse,PennerEasing);
var assetLoadCount = 0;
var bop:String;
var numOfItems:Number;
var counting:Number=0;
var home:MovieClip = this;
_global.forwardClicked=false;
_global.intervalID;
control.swapDepths(5000);
urlButton.swapDepths(5001);
function loadBitmapSmoothed(url:String, target:MovieClip) {
// Create a movie clip which will contain our
// unsmoothed bitmap
var bmc:MovieClip = target.createEmptyMovieClip("bmc", 9999);
// Create a listener which will notify us when
// the bitmap loaded successfully
var listener:Object = new Object();
// Track the target
listener.tmc = target;
// If the bitmap loaded successfully we redraw the
// movie into a BitmapData object and then attach
// that BitmapData to the target movie clip with
// the smoothing flag turned on.
listener.onLoadInit = function(mc:MovieClip) {
mc._visible = false;
var bitmap:BitmapData = new BitmapData(mc._width,mc._height,true);
this.tmc.attachBitmap(bitmap,10000,"auto",true);
bitmap.draw(mc);
assetLoadCount++;
cover.imgTotal.text = (assetLoadCount+" of "+numOfItems);
// trace(assetLoadCount+" of "+numOfItems);
if (assetLoadCount == numOfItems)
{
cover._visible=false;
if(counting==0){
loadBitmapSmoothed(item0.imgLoad, projector.imgHolder);
bop=item0.imgLoad;
textDisc.htmlText=item0.discText; }
}
};
// Do it, load the bitmap now
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(listener);
loader.loadClip(url, bmc);
}
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
numColumns = 14;
cnt = 1;
startX = startY = 0;
for(var i=0;i<numOfItems;i++)
{
var t = home.attachMovie("item","item"+i,i+250,{_x:startX+50,_y:startY+548});
t.imgLoad = nodes[i].attributes.src;
t.discText = nodes[i].attributes.disc;
var image = nodes[i].attributes.src;
//loadBitmapSmoothed(image,projector.imgHolder);
loadBitmapSmoothed(image,t.hex.image);
t.onRollOver = over;
t.onRelease = released;
t.numberInQuestion=i;
startX = ((cnt%numColumns==0) ? 0 : startX + t._width+5);
startY = ((cnt%numColumns==0) ? startY + t._height+8 : startY);
cnt++;
}
home.attachMovie("selector","selector",-1,{_x:item0._x,_y:item0._y});
}
function released()
{
removeMovieClip(behind_mc);
clearInterval(_global.intervalID);
destX=this._x;
destY=this._y;
textDisc.htmlText=this.discText;
var g:Fuse = new Fuse();
if(selector._x!=destX)
{
g.push({target:selector, x:destX, seconds:1, ease:"easeOutQuad"});
}
if(selector._y!=destY)
{
g.push({target:selector, y:destY, seconds:.5, ease:"easeOutQuad"});
}
g.start();
duplicateMovieClip(projector,"behind_mc",100);
control.getNextHighestDepth();
loadBitmapSmoothed(bop, behind_mc.imgHolder);
var d:Fuse = new Fuse();
d.push({target:behind_mc, _alpha:0, seconds:2, ease:"easeOutQuad", func:removeMovieClip, args:behind_mc});
d.start();
loadBitmapSmoothed(this.imgLoad, projector.imgHolder);
bop=this.imgLoad;
counting=this.numberInQuestion;
_global.forwardClicked = false;
}
function project()
{
clearInterval(_global.intervalID);
_global.forwardClicked = false;
var wait:Number=5;
var delay:Number = wait*1000;
_global.intervalID = setInterval(moveImages,delay);
}
function moveImages()
{
if (_global.forwardClicked == true)
{
clearInterval(_global.intervalID);
_global.forwardClicked = false;
};
trace(_global.forwardClicked);
removeMovieClip(behind_mc);
var t:MovieClip = home["item"+counting];
var n:MovieClip = home["item"+(counting+1)];
textDisc.htmlText=n.discText;
duplicateMovieClip(projector,"behind_mc",100);
trace(behind_mc._level);
loadBitmapSmoothed(t.imgLoad, behind_mc.imgHolder);
var z:Fuse = new Fuse();
z.push({target:behind_mc, _alpha:0, seconds:2, ease:"easeOutQuad"});
z.start();
loadBitmapSmoothed(n.imgLoad, projector.imgHolder);
if (counting != numOfItems)
{
counting++
} if (counting+1 >= numOfItems)
{
counting=-1;
}
bop=n.imgLoad;
destX=n._x;
destY=n._y;
var g:Fuse = new Fuse();
if(selector._x!=destX)
{
g.push({target:selector, x:destX, seconds:1, ease:"easeOutQuad"});
}
if(selector._y!=destY)
{
g.push({target:selector, y:destY, seconds:.5, ease:"easeOutQuad"});
}
g.start();
}
function backward()
{
_global.forwardClicked=false;
clearInterval(_global.intervalID);
removeMovieClip(behind_mc);
var t:MovieClip = home["item"+counting];
var n:MovieClip = home["item"+(counting-1)];
textDisc.htmlText=t.discText;
duplicateMovieClip(projector,"behind_mc",100);
loadBitmapSmoothed(t.imgLoad, behind_mc.imgHolder);
var z:Fuse = new Fuse();
z.push({target:behind_mc, _alpha:0, seconds:2, ease:"easeOutQuad"});
z.start();
loadBitmapSmoothed(n.imgLoad, projector.imgHolder);
counting--;
if (counting <= 0)
{
counting=numOfItems;
}
bop=n.imgLoad;
destX=n._x;
destY=n._y;
var g:Fuse = new Fuse();
if(selector._x!=destX)
{
g.push({target:selector, x:destX, seconds:1, ease:"easeOutQuad"});
}
if(selector._y!=destY)
{
g.push({target:selector, y:destY, seconds:.5, ease:"easeOutQuad"});
}
g.start();
}
function forward()
{
moveImages();
_global.forwardClicked=true;
}
xml.load("gd.xml");
control.bebop.onRelease=project;
control.forward.onRelease=forward;
control.back.onRelease=backward;
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 09-25-2006, 05:57 PM
View Complete Forum Thread with Replies
Sponsored Links:
Strange .swf Behaviour
in my "home" .swf i have a dummy movie clip in which i load other .swf's. things worked fine until i tried to load a .swf with a scroller into it. the .swf loads and is visible, but the scroller won't work. it's strange 'cause buttons and movie clips work fine, but not the scroller. what could have gone wrong? (of course the scroller works if i run the .swf outside the "home" .swf) please lead me to the right direction...
thanks,
taipan
View Replies !
View Related
Very Strange MC Behaviour
Ok. Make an MC containing a text box with a word (anyoword)
Then make a button with the code to rotate the MC you just made. _root.YourMC._rotation=10 (or any angle).
Ok this works fine right ?
Ok now edit the MC and change the text box to an Input text box.
Now try the button. The text disapears.
Does anyone know why this happens ? It is very frustrating.
View Replies !
View Related
Strange Behaviour
hi,
i have a movie with a button symbol called button and a movieclip symbol called circle. i want to resize the circle symbol, but if i add the following code to the button...
on (release)
{
width(circle)
{
_xscale += 10;
_yscale += 10;
}
}
not only the circle gets resized but also the button symbol itself. how does that come? what am i doing wrong?
thx
View Replies !
View Related
Very Very Strange Behaviour
my swf file runs and gives multiple trace messages (normally erros like cant connect to http://localhost......./somefile.txt),
it started out with just 1, now its all these
Error opening URL "http://localhost/flashservices/app/gateway.php"
Error opening URL "http://localhost/development/Resources/gfoxintro.txt"
Error opening URL "http://localhost/development/Resources/bridieintro.txt"
the thing is, is that i havent been doing anything with the source code for the part that is responsible for all of the above.
when i cut and paste the addresses into my browser, they get displayed just fine,
anyone have any ideas? could it be that some error somewhere else is causing AS to bail out here?
View Replies !
View Related
Strange Behaviour
Hi everybody,
I need to find a solution to something strange. I Have a movie with buttons, scrolls ect... When I publish the movie and open it wide screen (the client wants it full screen) everything starts behaving funny. Especially the scroll buttons and bar (custom one) . It doesnt stop scrollin when I take the mouse off the buttons, and behaves a bit crazy. Please, anybody knows why this happens ans the solution?
Thanks
View Replies !
View Related
Strange Behaviour Of WS
Hi I have a problem when I'm calling Web Service with interval of 10 to 60 seconds it returns it's nodes twice... which is strange because I checked my methods.. they seem to be ok .. I checked the WS it was ok... I tried to debug but you know the debugger in flash is horrible and of course it crashed:).. have you had such problem with WS or the mistake is in my code?
View Replies !
View Related
Strange Behaviour
Hi everybody,
I need to find a solution to something strange. I Have a movie with buttons, scrolls ect... When I publish the movie and open it wide screen (the client wants it full screen) everything starts behaving funny. Especially the scroll buttons and bar (custom one) . It doesnt stop scrollin when I take the mouse off the buttons, and behaves a bit crazy. Please, anybody knows why this happens ans the solution?
Thanks
View Replies !
View Related
Strange Behaviour
Hi everybody,
I need to find a solution to something strange. I Have a movie with buttons, scrolls ect... When I publish the movie and open it wide screen (the client wants it full screen) everything starts behaving funny. Especially the scroll buttons and bar (custom one) . It doesnt stop scrollin when I take the mouse off the buttons, and behaves a bit crazy. Please, anybody knows why this happens ans the solution?
Thanks
View Replies !
View Related
Strange Behaviour
Hey
A colleague of mine just hit an issue with an onEnterFrame piece of code she is working on:
------------
timer = 4;
onEnterFrame = function(){
timer = timer - 0.04;
trace(timer);
}
----------
partial output:
1.2
1.16
1.12
1.08
1.04
0.999999999999997
0.959999999999997
0.919999999999997
0.879999999999997
Weird huh?
I fixed her issue using Math.floor, but I'm curious what causes Flash to equate 1.04 - 0.04 = 0.999999999999997?
Maybe this is a well known issue but I hadn't come across it before.
Any ideas?
Thanks
Paul
View Replies !
View Related
Strange Script Behaviour
greetings,
i have set up a site using a flash interface to navigate.
initially when you enter the site, the buttons work fine.
however, when you have clicked once on each link, then go through the buttons again, they only ever return to the last link you clicked on. this also varies depending on which button you selected last.
is their some kind of cache thing happenin here that i am not aware of?
for visual refernce please visit:
http://www.aeongraphics.com.au/html/default.htm
make sure you go the 'portfolio' section (hieroglyphs to the left!) & click on all the links in the top menu: 'web design' 'flash' etc. once you have been through all of them - try the buttons again & you will notice that it will load only the last page you selected.
if anyone could advise why this may be happening i would be very grateful.
many thanks!
Mark.
View Replies !
View Related
Strange Script Behaviour
greetings, - me again...
below is my last post - i did forget to mention that the script i have used for each button is simply:
on (release)
getURL folio_frame.asp?name=Flash
- where 'Flash' changes according to the link.
these links open up pages that are generated by a database.
initially when you enter the Portfolio section of the site, the buttons work fine.
however, when you have clicked once on each link, then go through the buttons again, they only ever return to the last link you clicked on. this also varies depending on which button you selected last.
is their some kind of cache thing happenin here that i am not aware of?
for visual refernce please visit:
http://www.aeongraphics.com.au/html/default.htm
make sure you go the 'portfolio' section (hieroglyphs to the left!) & click on all the links in the top menu: 'web design' 'flash' etc. once you have been through all of them - try the buttons again & you will notice that it will load only the last page you selected.
once again - if anyone could advise why this may be happening i would be very grateful.
many thanks!
Mark.
View Replies !
View Related
LoadMovie Strange Behaviour
Hello!
I have a problem when loading external SWF into movies. I use loadMovie to load the external SWFs into an empty movie clip container. Everything works fine, but here is the problem: the external SWF have preloaders of their own, since they are large files, so when click (for example) on button 1 in the main Movie to load the external SWF number 1, it will start prealoding. BUT, if I click on button 2 before the first external SWF has finished preloading, the result is that the external SWF number 2 is loaded but I can't control it: it loops within its two frames . If I unload it, and load it again, it will still be wrong.
The external SWFs have two frames: the first one has the preloader, and the second one contains a movie clip with several images. They both load and work fine if I DON'T interrupt the preloading process...
Do you know why this happens? Is it clear enough?
Yo can see it "working" at www.argex.com/FreelanceWebFer.html
1-The main movie will load
2-There are two links at the top (CBT and Presentations)...click on any of them and the external movies will start preloading
3-Click on the other link before the preloader for the first one finishes, and you will see what happens...
I hope you can help me...
Thank you VERY much!!
Fernando
View Replies !
View Related
Strange, Unpredictable Behaviour ...
I'm no stranger to strange, unpredictable behaviour myself, my girlfriend can happily verify that, but this flash problem has got me stumped.
I'm trying to create a pretty standard flashsite. I have a main movie or index swf. into which individual pages are loaded using loadMovie action on a target.
A section of this site contains demos of the clients previous projects, also external swf files, that I've been trying to then load into the loaded section using the same method.
This works when tested on my machine, but once uploaded to the web it doesn't.
I've tried a way round this problem, by creating a target on the index swf that is referenced by the loaded section using the code :
_root.target .loadMovie ("demo.swf")
but have had no success there either ...
Other attempts using _levels have lead me to suspect you can't load 2 external swfs at the same time ....
can anyone tell me where I'm going wrong ?
thanks in advance,
morg.
View Replies !
View Related
[MX - MX2004] Strange Behaviour
Hi everyone,
as soon as I duplicate a movieclip, I have to initialize the new instance with some values.
mymc.duplicateMovieClip("mymc"+counter, counter)
with (eval("mymc"+counter)){
_x += 200
_y -= 40
_visible = true
}
I found no problem in setting these MC properties: they are immediately applied.
But at the same time, I also want to give a value to a label
with (eval("mymc"+counter)){
mylabel.text = "Instance no. " + counter
}
THIS FAILS! How is it? No matter what value I give to .text, it is always overwritten (or not changed at all) with the value of the original movieclip.
I'm stuck Is there an explaination for this? What workaround should i use?
View Replies !
View Related
Strange Behaviour Of Movieclip
I created a MC with animations. This MC has two labels within it called "pos1" and "pos2". An instance of this MC is placed on the stage by the name of "char".
I have attached this script on the main timeline of the stage -
direction = "up";
char.onEnterFrame = function(){
if(direction == "up"){
char._xscale = -100;
char.gotoAndPlay("pos2");
}
}
When the above script runs, the instance of "char" should loop between "pos2" and the end of the animation. However, this does not happen. The instance stops at the first frame of "pos2" itself.
This kind of problem has occured in the past as well, but has always been brushed off as a bug in the flash application itself. But this is flash MX that I am using. This shouldn't be occuring.
If anyone else has faced this problem too and has a solution to it, please help.
View Replies !
View Related
Strange ComboBox Behaviour
I have a combobox which I am updating with a remoting server and I have used this before with good results. However in this movie clip the the combobox gets updated and I can use the arrow key to select the items in the combobox but if I pull down the selector there is nothing in it.
This is the code:
getLyricListReply.onResult = function(result) {
trace("server responded: Records: " + result.getLength());
if (result.getLength() > 0) {
DataGlue.BindFormatStrings(cb_lyricList, result, "#name#", "#lyricId#");
}
else {
cb_lyricList.addItemAt(0, "Please Create a Lyric First", "NONE");
}
};
Why does the pulldown have nothing in it if I can select the items with arrow keys?
View Replies !
View Related
Strange HitTest Behaviour
Ok, I know this subject has been maybe discussed earlier, but this far I haven't found anything relative to my problem. So here it hyperlink to my swf-file: grid_test.swf
I have duplicated one square of the grid so that it creates the whole grid. My problem is next: why the circle doesn't make all the squares gray that it hits? Every square has a hitTest on it and it is testing against the circle. If this is stupid question, then excuse me, but I am kinda stuck here at the moment. Any useful piece of information is welcome.
(I am using MX pro 2004)
View Replies !
View Related
Strange Basic Behaviour
I have a small problem with a movie, which seems to be down to a strange basic behaviour of Flash.
I have created a *very* simple movie to reproduce this:
I have one movie on the stage, a simple rectangle.
This movie has 2 frames:
frame 1 is a blue rectangle
frame 2 is a red rectangle
in each frame I put a "stop();" command.
The movie has just the following code:
code:
on (rollOver)
{
gotoAndPlay(2);
}
So when I run the movie, here is what I expect:
- the rectangle is blue
- when I mouse over, it goes to frame 2, and display a red rectangle
- when I mouse out, nothing happens
- when I mouse over again, nothing happens (we are already in frame 2 - red rectangle)
However, here is what actually happens:
- the rectangle is blue
- when I mouse over, it goes to frame 2, and display a red rectangle
- when I mouse out, nothing happens
- when I mouse over again... it turns into a blue rectangle! So it goes back to frame 1!
After that, each time I mouse over again, it alternates between frame 1 and 2, regardless of the actionscript that tells it to go to frame 2 everytime.
Any idea why it is behaving like this?
Many thanks.
Hubert.
View Replies !
View Related
Strange GotoAndPlay Behaviour
Hi everyone,
I an experienced object-oriented developer getting my feet wet in flash and trying to put together a SF2-style fighting game. I have a movie that contains a Game movie clip/class which contains two Player movie clips/classes, each of which contains a static movie clip with a linkage name of "Frame." The "Frame" clip is empty and it's just used as a placeholder to load an external ".swf" file that contains the animations for the various actions the player can execute. This is done by executing
_someplayer.Frame.loadMovie("blahblah.swf");
everything works properly when the program starts. I attach an instance of the game class using attachMovie, the game constructor fires which attaches two instances of the player class to itself using attachMovie.
I use a custom loader movie(not the component provided in MX) which calls the Game's "Reset" method once it determines that all objects have loaded. This appears to work fine.
The game's "Reset" method calls the players "Reset" method. All this does is set some properties to initial values AND attempts to play the ".swf" loaded into the "Frame" object using gotoAndPlay. This is where the problem arises: it doesn't respond to gotoAndPlay command. I've tried using labels, and I've tried using frame numbers. No matter what it just plays the movie start to finish.
I heard that there could be problems with interacting with movie clips that you have dynamically created or loaded until you reach the second frame. However I also heard that movie clips that are dynamically created or loaded in 1 keyframe disappear as soon as a new keyframe is encountered.
Here is the relevant portion of the code:
Code:
Game.prototype.Reset = function (){
this._player0.Reset();
this._player1.Reset();
this._player0._x = Game.Player0StartingXPosition;
this._player1._x = Game.Player1StartingXPosition;
this._player0._y = PhysicsObject.FloorY;
this._player1._y = PhysicsObject.FloorY;
this._timeElapsed = getTimer();
this.onEnterFrame = Tick;
}
Game.prototype.Tick = function(){
// game loop
}
Player.prototype.Reset = function(){
trace("Player " + this._direction+" Reset");
this._canExecuteMove = true;
this._isAirborne = false;
this._isCrouching = false;
this._canReverse = true;
this._direction = direction;
this._canReverse = true;
this._isBlocking = false;
this._isLowBlocking = false;
this._isFalling = false;
this._startingAccelerationX = 3;
this._startingAccelerationY = 5;
this.Frame._scaleX = this._direction * 100;
// This command appears to do nothing.this.Frame.gotoAndPlay("Initialization");
}
View Replies !
View Related
Strange Behaviour In Flash
Hi
I have come accross something strange in Flash.
I have to different movie clips on their seperate layers on my stage, one is my logo and the other one is an animated text. now when I test my movie my logo disappeares for some reason, but if delete the animated text, logo become visible!! so I think for some reason flash put the text on the same level as my logo therefore logo gets deleted! that's my guess anyway but I might be wrong so please let me know if you know how to fix this.
Thanks
View Replies !
View Related
Strange Browser Behaviour
Hey guys,
I'm doing a little practice project for a band (It's a Flash website).
I've tested on my computer and another slower one and everything works fine. It seems to be doing some pretty odd things on the web though.
In Internet explorer only 2 layers show up, the logo and my link. The rest of the screen is blank. I've tried pointing IE directly at the swf (see link below) and it comes up but doesn't work fully.
A lot of the photos aren't loading in the photo galleries. I'm not using xml, just loading external swfs which are whole photogalleries with their own code.
...and in some browsers the _alpha properties of some of the photos seem to be a bit random.
Lots of odd stuff happens in Firefox too.
Here's the link:
http://www.watchtvlearnenglish.com/fym_site/fym.html
http://www.watchtvlearnenglish.com/fym_site/fym.swf
Any help on this would be greatly appreciated.
View Replies !
View Related
Strange XML Namespace Behaviour
Hi everyone...
I'm working on a class that creates and works with xml files. After some trouble with namespaces and a bug in Flex that I managed to get around, this is what I've got so far (simplified)...
ActionScript Code:
package uk.co.clockedin.test.test1{
public class LibraryData
{
public namespace ns = "http://www.clockedin.co.uk/test1";
private var xmlRoot:XML;
private function constructNewXML():void
{
trace("Constructing new XML object.");
use namespace ns;
xmlRoot =
<xml xmlns='http://www.clockedin.co.uk/test1'>
<library />
<counter nextID='1' />
</xml>;
}
public function insertItem(item:LibraryItem):LibraryItem
{
use namespace ns;
var newItem:XML = <item />;
newItem.@id = getNextId();
newItem.name[0] = item.name;
newItem.description[0] = item.description;
newItem.author[0] = item.author;
libraryRoot.appendChild(newItem);
return item;
}
}
}
Despite many ambiguities and strange ways of having to go about things (default xml namespace doesn't work in Flex for example), my main problem is with insertItem().
For some reason, my xml file is producing this...
ActionScript Code:
- <xml xmlns="http://www.clockedin.co.uk/test1">
- <library>
- <item id="1">
<aaa:name xmlns:aaa="uk.co.clockedin.test.test1:LibraryData">Sample Item</aaa:name>
<aaa:description xmlns:aaa="uk.co.clockedin.test.test1:LibraryData">Description of sample item.</aaa:description>
<aaa:author xmlns:aaa="uk.co.clockedin.test.test1:LibraryData">Timothy Jonathan</aaa:author>
</item>
</library>
<counter nextID="2" />
</xml>
Is it just me, or does this seem very odd? If I specified at the beginning of the code block use namespace ns, why is it not doing so? And what's all this aaa prefixing?
All I want is to add an item with the above-specified sub-nodes, and inherit the root node's namespace, namely "http://www.clockedin.co.uk/test1".
How can I do this and avoid this strange intrinsic namespacing? I'd prefer not to use a hack. I'm sure I ain't alone on this one...
Any suggestions?
View Replies !
View Related
Strange Trigonometry Behaviour?
I'm having some strange behaviour with my trig. Not something I've ever noticed before. I'm Trying to find the Cosine of 90 degrees:
ActionScript Code:
trace(Math.cos((90 * Math.PI/180))); //outputs:6.123031769111886e-17
Surely this should return 0, or am I going nuts? Is this perhaps some strange precision bug with AS3?
View Replies !
View Related
Strange Flash Behaviour
I'll explain the system first then the behaviour.
Intel 2.4Ghz running Mandrake Linux 9.1, using Mozilla 1.3 and latest Macromedia flash player v6 for Linux.
All the flash I have tested on this system works well, nice and fast.
However we have put together two simple Flash animations ( using MX ) that run really slow on these system configurations ( tested on 2 other similar setup machines ) The same flash works fine under IE and Mozilla using Windows. So basically these particular flash files ( and only these files ) are running slow.
Oh, BTW when I open just the swf into the browser it does the same thing, so I don't think its something in the object / embed tag.
I guess what I am asking is;
Has anyone seen this before?
What settings should I check for when I export the flash files?
What speed ( framerate ) is best for the average machine out there?
Thanks for any help..
View Replies !
View Related
Strange Basic Behaviour
I have a small problem with a movie, which seems to be down to a strange basic behaviour of Flash.
I have created a *very* simple movie to reproduce this:
I have one movie on the stage, a simple rectangle.
This movie has 2 frames:
frame 1 is a blue rectangle
frame 2 is a red rectangle
in each frame I put a "stop();" command.
The movie has just the following code:
ActionScript Code:
on (rollOver)
{
gotoAndPlay(2);
}
So when I run the movie, here is what I expect:
- the rectangle is blue
- when I mouse over, it goes to frame 2, and display a red rectangle
- when I mouse out, nothing happens
- when I mouse over again, nothing happens (we are already in frame 2 - red rectangle)
However, here is what actually happens:
- the rectangle is blue
- when I mouse over, it goes to frame 2, and display a red rectangle
- when I mouse out, nothing happens
- when I mouse over again... it turns into a blue rectangle! So it goes back to frame 1!
After that, each time I mouse over again, it alternates between frame 1 and 2, regardless of the actionscript that tells it to go to frame 2 everytime.
Any idea why it is behaving like this?
Many thanks.
Hubert.
View Replies !
View Related
Strange Math Behaviour
Hey everyone
I'm trying to turn a decimal number of some number of pi into a fraction (for angles and such) and i seem to have found an odd behaviour of the modulus function. I have the following 2 lines in my movie
ActionScript Code:
trace((3 *Math.PI/2 * 100) % Math.PI)
trace(Math.PI)
(the 3 * Math.PI/2 is a variable passed in, but it's that value)
Now, the trace it spits out is like so:
Code:
3.14159265358979
3.14159265358979
And this strikes me as odd - isnt' the modulus (%) operator meant to give the remainder of a division involving the second number, which would make that 0 instead?
I'm trying to use this to find out if the number is in fact some nice fraction of pi, and not just an annoying decimal, so i'd like it to spit back a 0 (or some very close number to 0, like 1e-15 or something )
Thanks
Edit: I think that it's some float error being increased due to the large multiplication... I changed it to a number larger htan 100 and it got into the visible area of the decimal... Does anyone know how i could go around this?
View Replies !
View Related
Strange Button Behaviour
I am seeing a very peculiar behaviour with the onPress & onRelease functions.
I have 10 buttons on a movie. The button functionality works fine. The thing is when I click a button once and then click it again a second time without moving the mouse it won’t work. So long as I move the mouse, even a pixel and then click it works !.
Very strange and very confused.
View Replies !
View Related
Strange Filter Behaviour
Hey Kirupians!!!
I'm trying to jazz up some of the text on the site I'm developing and I have encountered a strange side-effect from using filters on text. Basically, I have got a couple of dynamic text fields, each in it's own MovieClip. With no filters applied the text displays fine however... when I add a Glow or DropShadow filter for instance (at design time), the bottom few pixels gets chopped off the text. This occurs when the filter is applied to either the text field or the MovieClip and I have tried to resize the text field and it seems to make no difference. Has anyone else experienced a similar problem? I suspect that it may be the font (it is a custom font used by my University)... can anyone please suggest any way round this problem other than using a different font?
Cheers for now,
Andy McDee
View Replies !
View Related
Strange AS3 Next/prevFrame() Behaviour...
Hi guys,
I'm migrating some stuff to AS3 and have come to a dead end with this one.
Here's 2 examples to help you understand the problem: They present the difference between the AS3/AS2 implementation.
http://users.ntua.gr/el02173/prevFrame.zip
What you see is this: on the stage there's a movieclip called ball, which contains a 20-frame scale tween of another movieclip, called colorchange which contains a 40-frame color tween of a circle.
So, I've got sth like this: root--> ball (scale tween of colorchange - 20 frames) --> colorchange (color tween of a shape - 40 frames)
So, suppose I want to use ball as a button with a rollover effect that plays backwards... In AS2 I used the following code to enable the scale tweening (ball plays forwards when the mouse is over the shape, and backwards when the mouse is elsewhere):
ball.onEnterFrame = function() {
if (ball.hitTest(_root._xmouse, _root._ymouse, true)) {
ball.nextFrame();
} else {
ball.prevFrame();
}
};
Note that mc colorchange plays without any problem continuously. Check the file as2prevFrame.swf in the zip above.
Now, I migrated to AS3 and expected this to work:
ball.addEventListener(Event.ENTER_FRAME, HitTest);
function HitTest(e:Event) {
if (ball.hitTestPoint(root.mouseX, root.mouseY, true)) {
ball.nextFrame();
} else {
ball.prevFrame();
}
}
Check out what's happening (as3prevFrame.swf): The prevFrame() and nextFrame() actions on "ball" are blocking "colorchange" from playing properly. See the difference between the 2 swf's? What's the deal with this behavior? There is nothing in the code above that should stop the color tweening from playing properly, like it did with AS2.
I 've got plenty of experience with flash, but I can't figure out what to do with this one. Your insight will be much appreciated, because I've been making my flashier buttons like this for ages... and I'm at a dead end. Thanks.
View Replies !
View Related
Strange Behaviour .swf Header IE6 And IE7
Hi all,
I just made site with joomla + MisterEstate(Joomla component).
Everything is working fine except a strange bahaviour with a flash header made with rainbowheader(plugin for dreamweaver).
It's showing fine in every pages with firefox but it's not shown at all on single object pages in IE6 and IE7.
Other pages are ok both with IE6 and IE7.
This is a working page showing the header:
Home page
This is an object test page not showing the header:
Single object page
Strange, isn't it?
As I'm not an expert I don't know if it's a flash related problem or a dreamweaver related or if I have to edit something in MisterEstate and/or in my index.php template.
I hope someone can point me to the right direction.
Thanks in advance.
View Replies !
View Related
Strange MovieClip Behaviour
The strange behaviour I have not been able to figure out, is that when I add a particular set of movie clips sometimes they appear and sometimes they do not.
I am building a game that uses "paddles" on screen to bounce balls around. Every level you get another paddle to play with. My code is as follows:
Code:
for (i=0; i < level; i++) {//add a paddleElement for each level of the game
trace("time to add a new paddle!");
var p:paddleElement = new paddleElement();
p.x = 650;
addChild(p);
trace(p+p.name+" just got added at depth "+this.getChildIndex(p));
p.y = paddleY;// paddleY is a defined constant.
p.x=500 + 160 * i;// make space between each paddleElement
paddles.push(p);// track how many paddleElements there are
}
The trace commands return as you would expect. The second one always returns something like [object paddleElement]instance324 just got added at depth 23
The thing that I can't figure out is that sometimes when I get to the next level the paddles just dont' appear. But then if I restart the game maybe they work for that level but not for the next. It seems that they don't appear about half the time.
paddleElement is class that extends MovieClip
Can anyone see where I am going wrong?
Any advice would be greatly appreciated.
Thanks!
View Replies !
View Related
Strange Asfunction Behaviour
this is a strange one for asfunction
i'm constructing my <a> function call like this
Actionscript Code:
productVariations += "<p><a href='asfunction:_parent.itemOverlay,"+product+","+i+"'>I'd like to view this</a></p>";
to pass 2 dynamic variables - product and i - to the itemOverlay function but if i run
Actionscript Code:
function itemOverlay(product:Number, variation:Number) {
trace ("product: "+product+" variation: "+variation);
}
i get a trace of
product: 0,0 variation: undefined
so the asfunction call is passing 0,0 to the first (which surely shouldn't happen with a Number type) variable leaving no more arguements for the second one
what did i do wrong?
hope you can help
obie
View Replies !
View Related
Strange Behaviour Of RemoveMovieClip
Hi,
I am implementing Arkanoid (aka Breakout) and I have one problem with the removeMovieClip function.
The bricks are movie clips with 2 frames. When a brick is hit, I tell the movie clip to move on to the next frame. So some bricks have 2 frames, some have 4 frames, depending on how solid they are.
When they reach the last frame, there is a call to:
removeMovieClip(this);
This works fine, the bricks are removed when destroyed.
However, from times to times, TWO bricks are removed with ONE call to removeMovieClip.
I have put a "trace" in the onClipEvent(unload) and clearly, TWO movies clips are removed. They don't have the same name and they have different depths...
Here is the code to load the bricks:
nbBrick = 0;
for (j=1; j<7; j++)
{
row = j add "_";
for (i=1; i<=13-2*j; i++)
{
nbBrick++;
movie = row add i;
duplicateMovieClip(_root.fragilebrick, movie, nbBrick);
eval("_root." add movie)._x = _root.left._x + (i+j-0.5)*_root.fragilebrick._width;
eval("_root." add movie)._y = _root.topWall._y + (j*2-1)*_root.fragilebrick._height;
trace(eval("_root." add movie).getDepth());
}
}
Would anyone know why a removeMovieClip(this) from inside a movie clip call "3_3" removes also "4_3" ???
When this happens, it removes one brick without counting it out and when all the bricks are removed from the scene, the game continues cos the counter says 1 or 2 (sometimes 3) bricks remaining...
Please guys help me!!
Thanks in advance.
and sorry for the looooooong message but I wanted to be clear
View Replies !
View Related
Strange Behaviour With AttachMovie
Hi all.
I'm writing a test of using attachMovie and I found something I can understand.
First, this code works fine:
Code:
function seeButton(btnNumber) {
trace(btnNumber);
}
this.attachMovie('btnPrototype', 'btn1', 1);
this.attachMovie('btnPrototype', 'btn2', 2);
this['btn1']._x = 100;
this['btn1']._y = 100;
this['btn1'].txtPrototype.text = 'boton 1';
this['btn1'].btnActionPrototype.onPress = function() {
seeButton(1);
}
this['btn2']._x = 100;
this['btn2']._y = 115;
this['btn2'].txtPrototype.text = 'boton 2';
this['btn2'].btnActionPrototype.onPress = function() {
seeButton(2);
}
So, i wrote a bit complex example:
Code:
var total:Number = 10;
var x0:Number = 4;
var y0:Number = 6;
var btnHeight:Number = 13;
for (var i:Number = 0; i < total; i++) {
this.attachMovie('btnPrototype', 'btn_' + i, this.getNextHighestDepth());
this['btn_' + i]._x = x0;
this['btn_' + i]._y = y0 + (btnHeight * i);
this['btn_' + i].txtPrototype.text = 'probando el botón ' + i;
this['btn_' + i].btnActionPrototype.onPress = function() {
trace('testing button ' + i + '.
');
};
}
this allways traces "testing button 10".
I'm a bit confused with this because I don't understand why first example works and second example doesn't.
Any ideas?
thank you all
^_^
View Replies !
View Related
Help: Strange Behaviour Of Flash When Published
I have a problem with my new site. I have finished the work, I have tested my site entirely on our local server, everything worked.
Yesterday evening I loaded everything up to the Internet server. When I looked these morning if my site was working properly, I saw he wasn't at all. He did not work, or hardly. The problem continues to exist, even after a whole day working intensively on the problem, I can find no solution.
I firstly thought that it would be a matter of Java script; which I use in my html file. That is incorrect.
(www.studieburomouton.be/index0.html) or without popup:
(www.studieburomouton.be/studieburomouton.html)
the long range of small pics under the item portfolio is not working as it ment to be.
It has to work as follows: this movie gets the number of pictures he has to load by means of a txt file, with this number he starts with duplicating itself as much times the txt file told him to do. Each
pic corresponds then with a project. But, that
duplicatieMovieClip do not work when the site is examined
online.
Can someone help me? I don't have the spirit anymore!!!!
thanks
dries
View Replies !
View Related
Strange Behaviour With File Sizes?
Hello all.
I have a project that originally had Photoshop images for the background. I was trying to optimise my movie so I reduced these files down in size by using the save for web option in Photoshop. My .fla file went from 23,514 Kb to 23,024 Kb. However, my .swf file went from 611 Kb to 690 Kb. Why??? Also, these files are still too big, especially considering I still have a lot of content to put in the movie. Any suggestions for further optimisation? Also, how much do different fonts affect file sizes? Would using a plain font like Arial lower my file size significantly versus a more fancy typeface?
Thanks as always for everyone's help!
Tulane
View Replies !
View Related
Strange Duplicated Movieclip Behaviour...
Hi all,
i have a movieclip of a spaceship, with other clips inside, ie rotating radar dish etc. I have attached code to the clip, so it moves down the screen.
when i place the clip (with code) on the scene, it works.
If i make it invisible, then duplicate it onto the screen later on........it just sits like a graphic.
i have checked all my clip behaviours, because to me it really does look like this is the problem(not saying it is).
I also tried using the attached ship clip (instead of a duplicated copy). Making it invisible upon movie startup, then making it visible, and moving to right place, when it was needed. Again it just sat there like a graphic.
what could make it act this way?
here is the attached ship code:
code:
onClipEvent(load){
var issdamage=50;
}
onClipEvent(enterFrame){
if(this._y>=300){
if(_global.shipflashing==false){
if(this.isspic.hitTest(_root.game_ship)){
_root.game_ship.enemyhitship=true;
this.issdamage-=1;
}//end hittest if
}//end flashing if
if(this.issdamage<=0){
_root.attachMovie("shipexplosion_exp","issexplo_at t",150);
_root["issexplo_att"]._x=this._x;
_root["issexplo_att"]._y=this._y;
this.removeMovieClip();
}
}else{
this._y=this._y+2;
}//end outer if else
}//end event
View Replies !
View Related
Strange Publish Behaviour - No Antialiasing
Hello there - Please help!
Most strange Flash Mx 2004 behaviour occured, when publishing flash movie. I wanted to add preloader to 'beta' site version - www.metapages.npc.pl (this is with antialiasing working)
But, when tried to add a new scene or new frames with a preloader, movie is published without antialiasing on bitmap edges (tiff). Frankly, movie is published without antialiasing on those bitmaps even without preloader, even when I try to move frames with bitmaps further than frame 1 (everything is placed on different layers in frame 1).
There`s no difference between those 2 flash movies, except that in second one everything is placed in frame 5, not 1. Please see the results and give me an answer, why tiff`s there are so messed up.
www.metapages.npc.pl/index.html (antialiasing working)
www.metapages.npc.pl/index2.html (antialiasing not working)
(both movies without preloaders so please be patient - 260kb both)
Thank U!
JedrekO
View Replies !
View Related
Strange Preloader Behaviour [mx04]
I've got tis preloader on my movie and it works fine.
the problem is when this movie loads into another movie, the percentage counts up to 100%, the bar scales up and everything's as it should be except it doesn't gotoAndStop(3) like it should.
So why does it work on its own but not inside another movie?
P.S. the "_"s are there (i.e. "bytes_Loaded") because I tried it with unique variable names... still no luck.
code: stop();
//Preloader: initialise variables
var bytes_Loaded:Number = 0;
var bytes_Total:Number = this.getBytesTotal();
var percent_Loaded:Number;
//Calculate loading progress
this.onEnterFrame = function():Void{
if(bytes_Loaded<bytes_Total){
bytes_Loaded = this.getBytesLoaded();
percent_Loaded = Math.round(bytes_Loaded/bytes_Total*100);
if(bytes_Loaded<bytes_Total){
loading_txt.text = "Loading... "+percent_Loaded+"%";
loader.fym_bg._yscale = percent_Loaded;
}else{
loading_txt.text = "Loaded";
loader.fym_bg._yscale = 100;
wait();
}
}
}
//Wait for 1 second before going to frame 3 (main content frame)
function wait():Void{
var time:Number = 0;
this.onEnterFrame = function():Void{
time += 1;
if(time >= 50){
delete this.onEnterFrame;
this.gotoAndStop(3);
}
}
}
View Replies !
View Related
Strange Behaviour Of Swfs Loading Into Each Other
Hi everybody. I have 3 differents swfs being each one a gallery. Each gallery has the same code and features a scroller that reacts on mouse position from right to left. Each gallery loads the 2 others with 2 buttons. The problem comes when I switch from one gallery to another : the scroller speed increases each time that I call another swf/gallery. As far as I can understand is that each swf loads on the top of the other and so, my mouse scrolls over several scrollers at once. How can I solve this problem ?
I am sure that my code is not the best ( even if all swfs are loading fine) but I can not finalize this.
Can somebody tell me what is wrong ??
TXX
a_mc.onRelease = function() {
loadMovie("agallery.swf", 1);
_level0._visible = 0;
};
t_mc.onRelease = function() {
loadMovie("tgallery.swf", 1);
_level0._visible = 0;
};
View Replies !
View Related
[CS3] Strange Flash Form Behaviour
This is really odd...
I have created a Flash form which functions perfectly when I export it to the local Flash Player, but when I upload the file to the web, it acts strangely.
The Submit button does not roll over or click down.
You can download my FLA file from this URL....http://forums.flashgods.org/strange-...iour-t307.html
I also pasted the link below to the online version which is not working properly (these are exactly the same files)...
Go to the Contact page on this URL...
http://the1031solution.com/QA/index.html
Cheers guys
Kit
View Replies !
View Related
(onScroller) Function Has Strange Behaviour
Hi.
I have a scroller knob (button) in a group with a textField and at different frames I move the group from one side of the screen to the other to have a different page configuration.
I also track scroll changes in the textField, ie mouse wheel scrolling and place the knob at the appropriate _y position:
Code:
htmtxt.onScroller = function () {
knob._y = Math.round(((htmtxt.scroll-1)/(htmtxt.maxscroll-1))* 337 + 137);
}
The problem is that because this onScroller function is in an action for the first frame, it takes the _x value from the first frame, even though I never state the value, and when I move the group to the other side of the screen, the onScroller function still tracks the first frame _x value.
(If I comment out the line in the onScroller function body, then there is no problem about the location of the button "knob".)
Is there some way of placing this onScroller function so it doesn't act like this? (I wanted it to act as a general function accessible wherever the location of the button at a particular keyframe -- I really wouldn't like to have the function duplicated for every time I change the page configuration.)
Thanks for your thoughts.
spin
View Replies !
View Related
Strange Actions Panel Behaviour
Something very odd has been happening lately in my Flash CS3 concerning the actions panel...
If I add some actions on the main timeline then they appear in the actions panel explorer on the left as they should.
If I add some actions, for example, to a movieclip's timeline, they do not appear in the actions panel explorer (the left pane), meaning I have to pin every actionscript that is not on the main timeline, which is very annoying and not easy to navigate.
Does anyone know if there is a setting I can change to correct this or is this normal for CS3? ( i doubt it! )
Thanks
View Replies !
View Related
Strange Behaviour Of A Combobox In Firefox
Dear all,
I created a flash 10.0 movie with a combobox on it which get automatically filled from actionscript 3.0. If one presses ENTER or a button the text of the combobox or the selected item is used to fill a textfield, in the click event function of the combobox I have a line
ActionScript Code:
myCombo.close();
I have 2 problems with the combobox which only occur in Firefox:
1. The combobox dropdown list does not close
2. When a user clicks back on the combobox and tries to type in a new word one letter is only shown and gets selected each time, which prevents the user from typing in a whole word.
One else had the same experience? Any work around, because this look like a bug to me....
Regards
Daan
View Replies !
View Related
Tween.. Strange Behaviour When It's Finished.
Hello, did anyone expercienced this:
I have some buttons that initialize a tween effect, with an onRollover and an RollOut.
The rollOver is:
var TweenSubMenu:Tween = new Tween(currMovie, "_y", Strong.easeOut, 0, EindposY, 1, true);
and the Roll Out is:
var TweenSubMenu:Tween = new Tween(currMovie, "_y", Strong.easeOut, currMovie._y, 0, 2, true);
Now what is strange is that when the ween moves down (roll Over) that at the end of it's tween
is suddenly jumps to it's original _y position?
This only happens when you set the time for the rollout to 2 seconds. If you set it also to 1 second it works just fine.
Does anyone know what happens here?
Regards,
Micheal
View Replies !
View Related
File Plug-in Strange Behaviour
Hi all,
I'm trying to publish a stream using my own File Plugin but I don't understand how the FMS wants to use it.
When I publish a stream using NetStream.publish("streamname", "record") the FMS:
1.- opens the file to read
2.- query all the attributes of the file (using the handle). I return size '0' (the file is empty).
3.- tries to read 294912 bytes.
4.- the file is empty, so I tell the FMS that I've read 0 bytes.
5.- closes the file
6.- queries all the attributes of the file (using the name).
7.- open the file to read & write
8.- queries again the file.
9.- tries to read 294912 bytes, but the file is empty.
10.- closes the file.
The client gets 'NetStream.Record.NoAccess'.
I don't know what the FMS is expecting from the File Plugin. I'm trying to follow the documentation and the examples, but it doesn't work.
Any clues?
Thanks,
Jorge
View Replies !
View Related
Strange Behaviour Of Pixelfonts When Loaded Into Mc
Hi,
I'm having an swf with pixelfonts. When rendered, they are sharp.
When I load this swf in another it gets blurry. Into a level or an empty mc, doesn't mather, they become blurry. No scaling going on, round positioning etc...I use them for years...Is this flash 8?
Don't understand it but freaky annoying :s
Anyone experienced this / work around?
thanks in advance
H
View Replies !
View Related
Strange Mouse Behaviour Problem
I have a strange problem whereby the mouse click is not registered if the mouse is not moved. I have concluded that it's because the mouse does not call a RollOver on the movieclip button. i.e. because it stays in one position on the screen.
Is there a way around this, with perhaps a hitest for example?
Here is the .fla with the problem duplicated
http://www.fileqube.com/shared/OCpoWOeS126923
Thanks in advance
View Replies !
View Related
.. Populating FComboBox - Strange Behaviour
Hi everyone,
...maibe manny of this comunity have on the past my problem.. so I decide to put this question -( I'm not a greath coder in AS , I am new >> maybe is a simple thing that I ask.. )-
So: From an ComboBox populated by an XML file, I send a variable (id_user) to an php file onChangehandler.
This php return from table, projects associated to each ID_USER. On SWF this string, become Array and this Array must populate second ComboBox.
The problem is here >> The second ComboBox is populated correct ONLY after I select
for second time something in first ComboBox.
The older values remain inside second Combobox - >> only if I select the same Selection second time in First ComboBoxI see the change.
is a recursion problem here ? - or this is happened because on the same handler action
I send Variables to php for query and on the same event I espect the result on second ComboBox ?
Have someone a solution for this ..
Respects
Thanks for your time ...
View Replies !
View Related
FLASH + CSS HTML Links Strange Behaviour
hey,
I load external text files using loadvars and also use external css file and I load all content(swf's) in a master.Swf using MovieClipLoader...
Everything works fine, also a:link, a:hover, ...
But when I click on a link, my whole text becomes black...(so not only the link, the complete textfile...). And there's nowhere in the file where I define such thing.
Anyone any idea?
It seems that when I click, the loaded css file stops working or something.
You can check for yourself on www.mochica.be (not quite finished). It doesn't seem to happen the first time you load. But if you skip over to other menu elements, eg first you go to biography, then contacts who also use the same css-file, and then go back to the links, and click on one, all text becomes black... I really don't get it...?!
View Replies !
View Related
|