_width Not Changing During Tween. Is It Useless?
I was disappointed to find that I could not use the _width property of a tweened movieclip instance to know how large the mc is at a given time.
Am I just not getting something??
A breakpoint in the onEnterFrame() function shows that _width is always the LARGEST width the movieclip ever has -- not its CURRENT width. In my case the mc is being made larger and larger, using a tween made in the authoring environment. The clip starts out tiny and ends up 400 pixels wide, but the _width property is 400 the entire time!
What gives??
i really appreciate enlightenment! rwelti
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 08-29-2004, 09:02 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
_width Not Changing During Tween. Is It Useless?
I was disappointed to find that I could not use the _width
property of a tweened movieclip instance to know how large
the mc is at a given time.
Am I just not getting something??
A breakpoint in the onEnterFrame() function shows that
_width is always the LARGEST width the movieclip
ever has -- not its CURRENT width. In my case the mc is being
made larger and larger, using a tween made in the authoring
environment. The clip starts out tiny and ends up 400 pixels wide,
but the _width property is 400 the entire time!
What gives??
i really appreciate enlightenment!
rwelti
_width And Then A Tween
To give you a basic idea of what I'm doing, I'm loading in a menu from XML and then creating new buttons with the data. What I want is to have a box tween from 0 alpha to 100 in the background behind the box.
I have it all working, except when I change the _width property of the boxMC so it scales to the length of the XML menu, the tween no longer works. It appears the right length, but it will no longether tween.
//eval(strName).behindNavMC._width = lastStrLength + 5;
When I remove that line the tween works, but the box is a fixed size. When I add the line, the box won't tween, but it's the right size.
I tried searching for a solution because I imagine it's been encountered before, but I had no luck.
_width Is Changing The X Coords...?
I am making a progress bar and most of it works, except when I make the changes the _width property of the mc. for some reason when the incrementation is done on it the x coords is what changes and it races across the screen. I have tweaked it to make the incrementation on the height and it works fine. so I am really lost. Is there a bug that I don't know about?
Here is the code for the first frame
onEnterFrame = function()
{
var percentC;
percentC = _root.getBytesLoaded() / _root.getBytesTotal();
_root.progressBar_mc.bar._width = 130 * percentC; //here is where if I change it to _height it works fine
test._width = 130 * percentC; //test mc on main timeline it works fine, but is a simple object, the other progress bar looks much better
}
Here is the site to see what I mean
http://www.quantics.ca/flash/01_ProgressBar.html
it is the blue scrollbar that is acting funny, the red one is the simple one
Thanks for the help
_width Is Changing The X Coords...?
I am making a progress bar and most of it works, except when I make the changes the _width property of the mc. for some reason when the incrementation is done on it the x coords is what changes and it races across the screen. I have tweaked it to make the incrementation on the height and it works fine. so I am really lost. Is there a bug that I don't know about?
Here is the code for the first frame
onEnterFrame = function()
{
var percentC;
percentC = _root.getBytesLoaded() / _root.getBytesTotal();
_root.progressBar_mc.bar._width = 130 * percentC; //here is where if I change it to _height it works fine
test._width = 130 * percentC; //test mc on main timeline it works fine, but is a simple object, the other progress bar looks much better
}
Here is the site to see what I mean
http://www.quantics.ca/flash/01_ProgressBar.html
it is the blue scrollbar that is acting funny, the red one is the simple one
Thanks for the help
[F8] Changing Instances After Tween
Hi,
I have a problem that's been bugging me for a while. I've just been working around it by adding another layer each time, but that's getting out of hand.
I noticed sometimes, after a tween, you can't change the instance of a graphic symbol (meaning you can't change the frame the graphic symbol is showing) after a tween, and sometimes you can.
The times when you can, there is a vertical line before the last keyframe of the tween, and when you can't, there isn't.
How do you change the instances of a graphic symbol after a tween?
Changing Tween Ease With Script
Is there a way to change the ease (in and out) of a motion tween using action script?
I kinda think there isnt but its worth asking. I got a very long motion tween with keyframes along it that are stopped at depending on what button you press. There isnt any ease at the moment and i want a way to make the tween real smooth no matter where it stops at.
Any pointers would really help.
Steven[mlahero]
Changing Alpha In A Shape Tween?
I have a shape-tweened object that grows, but I want its alpha to increase too, so that at the last frame it is invisible. However, in shape tween I cannot alter the alpha of objects since they are broke apart.
How can I do?
Changing Alpha Percent On A Motion Tween
Hi, i have just made the jump from flah 5 to flash mx.
1 thing i cannot seem to get my head around is that the simple way to change the alpha transparancy on a motion tween keyframe in flash 5, which was to just select the keyframe and then select the alpha from the effects pannel does seem to be there in flash mx.
The only way i can change the transparancy of a motion tween keyframe is to change it to a graphic and do it from there.
This must be a stupid question, because there has to be an easier way, im just to blind to see it i think.
Is there a more simple way to do this?
Thanks,
Ritchie
Changing Color In A Movie; Breaks Tween
Thanks in advance for any assistance.
I have created a very simple movie that consists of a 60-second timeline with B/W letter vector outlines that have motion and scale tween. Everything worked great, now the client wants to add color. I want now to add color to the outlines. But when I select the beginning and ending frames to apply color, the scale tween stops working. I do get an error message (yellow triangle) that it only works with groups, but each layer is grouped already. Any ideas?
Tween Easing Functions - Changing The Strength?
I'm using the Tween class properly for the first time today and I've got a Bounce tween working nicely, which of course is nothing special. Only, it bounces a little too aggressively.
Is there a way to make the bounce rebound a little softer? Create a custom easing function maybe?
Many thanks.
James.
Smooth Text Tween When Size Changing?
Hi everyone,
Was wondering if there is a fix yet for making text tween from one size to another smoothly without it looking like a juddery, wobbly mess.
Thanks heaps.
[MX04] Aspect Ratio Changing During Alpha Tween
I'm trying to just fade one image in then out over the top of my background image. Both images are the same size as the stage. There is no motion involved, just a change of alpha from zero to 100, then 100 to zero.
During the transitions, the top picture pops to a slightly stretched version. This is reproduceable, as I struggled with four different images in a previous project file.
[rant]I'm used to the aspect ratio of still images changing during fades in Premiere. It doesn't make sense, but I'm used to it. Now the problem has migrated to another type of software with a totally different technology. Maybe I can try a fade between two different 35mm slide projectors and the glass slides will stretch during transitions, too.[/rant]
So, why does this happen? How do I kill it?
Thanks for any replies.
I Am Useless...
Does anybody helping me to push my homepage up...!http://de.geocities.com/lambrettafanclub/Film2.html i need more actions in it...and afterall i need i cool intro! just like the one from 2advanced => http://www.highersourcemusic.com
Do you have time to help me? If yes please contact me...so i can mail you the *.fla..Certaintly i will pay you..
thx
adrian
God I'm Useless
How do I load another movie into the existing window of my movie if the other movie is stored on my hard drive? there are som amy different options in the load movie actions parameters i dont know what does what.
I'm Useless
Ok I have to make a website for my class - but I'm having trouble.
I have everything working so far, I just need to link pages.
Now I'm thinking I have to load them externally with swf - and I used a tutorial here but it doesnt seem to work.
Can someone look at my file and see what I'm doing wrong??
thanks!
http://download.yousendit.com/790C9DBB4ED10CD8 <the file
Problem Creating Duplicate Movie Clip But Changing One Motion Tween
Hi I am currently having a problem creating movie clips.
I have created a movie clip which is an animation containing 5 different layers and 3 different motion tweens. I duplicate this movie clip and wish to change one of the motion tween's but when I change the motion tween in the new movie clip, it also changes the motion tween in the old movie clip.
I have tried removing the motion tween in the new duplicated movie clip, and creating a new motion tween but this still gives me the same problem as above where the original movie clip now contains the new motion tween.
Please help.
Thanks,
Dan
Key.ENTER Is Useless
Hi all,
I'm developing a game that playing with keyboard. But the ENTER key is not works.
i need any help. thanks.
ActionScript Code:
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
switch (Key.getCode()) {
case Key.ENTER :
trace("ENTER pressed");
break;
}
};
Key.addListener(keyListener);
Useless Code
It's late at night, so I'm easily amused, but I thought that was kind of cool.
ActionScript Code:
trace( hierarchy(MovieClip, Object) );
function hierarchy(top:Class, stopAt:Class=null):Array
{
if (stopAt == null) stopAt = Object;
var name:String;
var listing:Array = new Array();
var found:Class = top;
listing.push(found);
while( found != stopAt && found != Object && found != null)
{
name = getQualifiedSuperclassName(found).split("::").join(".");
found = getDefinitionByName(name) as Class;
listing.push( found );
if (found == Object) break;
}
return listing;
}
trace("");
trace("===============");
trace("");
trace (hierarchy2(MovieClip) )
function hierarchy2(top:Class, stopAt:Class=null):Array
{
var desc:XML = describeType(top);
var topC:String = desc.factory.@type;
var list:XMLList = desc.factory.extendsClass.@type;
var objs:Array = new Array(topC);
for each(var c:String in list)
{
objs.push(c);
}
return objs;
}
cheers
Useless Url Links
It is strange that the flash permit us to create HTTP links in textfields from HTML but these links really do not function! The links are visible and the pointer of the mouse indicator becomes a hand, and the links they can cliqués, but the URL not opened. The page remains itself. Like that I am not understand what the point is.
Useless Topic:
Sorry for the double post.
Edited: 11/21/2008 at 05:39:35 AM by Johnny Grows
ExternalInterface.... Useless
After DAYS of trying to figure out why i can not get a .NET application, OR javascript to call a functions using the ExternalInterface API.. I've found this:
http://groups.google.com/group/macromedia.flash/browse_thread/thread/012254300a6e84d0/3cc56242e797f73b
I've done everything via the links there, tried to install older version of the ActiveX control..... which I am COMPLETLEY unable to do. I've uninstalled the controls using the clean, have downloaded the older versions, have done everything I've found on adobe's help and other links on line, and it will ALWAYS tell me that a new verison is available (oh, and I've tried to unplug from th einternet too, with no results).
I've read this as well:
http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_05.html
and the policyfiles.txt will not return any erros.. yet in .NET (C#) it tells me there is an E_FAIL error (http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=665&threadid=1333217&enterthread=y).. and I can't get it to stop.
per the first lin, it looks like Adobe as blocked anything from calling a function in Flash with the new 9.0.115.0 version.. so why do they even have an ExternalInterface API available? I've set the security IN flash to "*" and through code in javascript, set the AllowScriptAccess to always, which doesn't work.. if I try to set this in .NET, it gives me another E_FAIL error..
so when is this going to be available again? according to the first link, a tickets been open, but see no results for it..
Totally Useless
I am sure this will be of no use to anyone but what the heck!
.swf
.fla
Import The Useless
I import some sound in the flash animation. But later i found even better sound to replace the old. Then after i replace, the old sound remain in the flash. Everytime, i add sound, i saw a list of the old sound, can i delete it? How do i delete it? Thanksz//
Buttons Are Useless?
buttonMC.onRelease = function () {
//code to do something
};
buttonMC = a movie clip // not a button
My movieclip now works as a button.
Why would i ever want to use a button symbol?
this places code in my timeline rather then on my button.
the only reason i can see using a button is for a rollover state.
any thoughts?
( also there is no reason for invisible buttons anymore either / right? )
thanks,
mix
Useless Thread Most Helpful
Hello,
This thread has nothing to do with actionscript. Just wanted to take a moment and thank some of the folks that visit this board and are most helpful. I haven't been coming here long, so I'm sure I am going to leave out some of the heavy hitters that come here, but, my vote for "most helpful" and "most knowledgeable" goes to.............
"musicman"
"philterdesign"
"rapidcarbon"
"jls2k"
Thx!!!
Like I said, I am sure I am missing alot! Who would you add to this list?
Regards
~GD~
"Share the toybox!"
MovieClip.onLoad == Useless ?
I'm trying to execute some code after a movie have been load
Code:
mc.loadMovie("window.swf", 0);
mc.onLoad = function ()
{
trace("onLoad called");
mc.drawWindow(200,200);
}
but this is not working.
Is there a way to use MovieClip.onLoad ??
Martin
These Useless Adobe Boards
These Adobe boards are not very useful with so little traffic (how many posts with 0 responses?). And having such noticeably little traffic keeps the traffic low -- why waste precious time posting as I have done with such little chance of assistance?
Solution: get Adobe support people in masquerading as users to actually get questions answered, so the boards will grow in popularity, and eventually be self-supporting.
Is List Component Useless?
Hi there!
I populated a List Component.
How can I trigger an action when selecting one item in the List?
For example: open a mc to enter a corresponding value in a field...
Many thanks in advance for your lessons!
Best regards,
Gerry
Frankly, The ADDED_TO_STAGE Is Really Useless :(
It just mess up my code.
Sometimes it just triggers for extra times.
Why not just use
var s:Sprite = new Sprite();
addChild(s);
s.init();
instead setting a "initHandler" function listening to the ADDED_TO_STAGE event.
Microphone Class Useless?
I am trying to save the audio stream coming from a microphone but people have been telling me that it can not be done. Why have a Microphone class if the stream cannot be saved? Why would I just want to let the user talk to himself?
Flash Media Server costs $4,500. Can someone let me know with 100% certaintly whether saving the audio stream from the mic is possible in Flash?
Thanks.
Are Old Books On Actionscripting Useless?
With Flash changing so much, what books are current and which one's are not? With what version of Flash did actionscript 2.0 start? Can I still use the book "Macromedia Flash 5 Advanced" for example, or will the code be old?
Is there Flash mx AND Flash mx 2004 or am I making this up? If so, what is the difference between the two?
Interactive Maps (help A Useless Newbie)
Hi,
I've already posted in this forum on this topic. Unfortunately it seems to have died without me getting the help i needed, (Thanks to those who did try to help me) or if it hasn't died then people are taking too long to answer (not blaming them, i just need to move on).
I'm not exactly new to Flash but i don't ever get to use it enough to move past beginners stage.
My project involves:
Starting with a map of Scotland, UK.
This map has 8 outlined regions which are supposed to be hotspots. Clicking these loads another SWF of that region in more detail.
The map should allow you to zoom in, move around, and reset it to it's original position. It also has a SELECT button for when you just want to select a region.
I downloaded an interactive map from FK and got the zooming/moving part of it working.
I've placed the index map (whole of Scotland) HERE so you can see what i mean.
I have messed around, trying to add the AS (that moves and zooms the map) onto the hotspots too but couldn't get it working.
The zoom and the pan are cool, but when i add a hotspot and then pan, the hotspot doesn't pan with the map!
The white rectangles are the outlines of where the hotspots will go.
I added a hotspot (top right) in MC 'main movie' which worked on initially opening the swf but wouldn't pan with the map - basically it stayed in the same position! I think this is probably best if i can just get the hotspots to move with the map?!?
NEXT UP:
I posted this in the AS forums after being directed there. Someone did help (THANKS) but i can't do what they suggested.
I've attached a FLA which only has a button in it HERE (17 kB) so someone could implement this suggestion.
Quote:
just make a button with dynamic text that has an instance in it likecode: duplicateMovieClip("button1","button2",2);
duplicateMovieClip("button1","button3",3);
duplicateMovieClip("button1","button4",4);
button1.btext = "Button 1";
button2.btext = "Button 2";
button3.btext = "Button 3";
button4.btext = "Button 4";
My button has a tooltip/altTag box that it pops up in it's rollover state. I'd like to make the text that's in the MC (placed in the buttons OVER state) editable for each instance of the button.
I just want one button, with many (text editable) instances.
I really appreciate any help.
NEXT UP - buttons that react differently based on their position to the stage
I've made 4 different versions of a button. The button 'grows' a box with a small bit of info (like an ALT tag or tooltip). The 4 different versions grow in different directions (NE, SE, SW, NW).
They will be placed on a map to draw attention to it's landmarks. The map will be movable which means that the buttons will grow in the correct direction at first, but if the map is moved...
I'm hoping someone can show me a way to have the button load a different MovieClip for it's OVER state based on it's position.
I was advised to use this:
if (mymovieclip_mc._x >= 100 or mymovieclip_mc._x <= 200 and mymovieclip_mc._y >= 100 or mymovieclip_mc._y <= 200){....
Unfortunately, he wouldn't help me any more than giving me this code. Which, for what i'm doing, doesn't actually help me.
-------------------------------------
So, to recap:
The buttons need to decide which MC to load (into their OVER state) based on their position on the stage. I also want to be able to assign a bit of text to each instance of this button without actually duplicating the symbol.
----------------------------------------
I know there's a hell of a lot of stuff here! I don't just expect others to do everything. But i do need some real help to move on, not just hints and bits of AS.
If i can't make any progress by the end of the day then my boss says i have to give up. Also, no offense but, if you think you can help then realise you can't, please let me know. I've been waiting for several days for a reply from someone who said they would help and it's really caused me problems.
Thanks for reading my v.long post and please help if you can. Cheers.
Browser Makes Preloader Useless
When viewing swf files, the browser wont show the swf until the swf file is fully loaded, thus not showing the preloader at all. How do I get around this within the flash file?
WOOHOO... Yet Another Useless Class, TabOrdering
Again, trying to prepare for my next project and came up with another useful class.. anyway I'll list the class, and then show an example fla code, as usual.
What this does is allow you to save tabbing configurations, let's say you have several forms on a page and the user can go back and forth between them.. what you'd do is create a tabbing order and name it (personalInfoOrder, purchaseFormOrder) and give it an array of the items in the tabbing order that they are meant to be viewed in. You can then just simply call setTabOrder() passing in the name of the tab order you want to use, and it will clear the old and set the new.
Enjoy.
TabOrderManager.as
ActionScript Code:
class com.createage.accessibility.TabOrderManager
{
private static var instance:TabOrderManager; // singleton
// a list of all the tab orders
private var tabOrders:Array;
// the current tab order
private var currentTabOrder:Array;
/**
* Constructor
*/
private function TabOrderManager()
{
tabOrders = new Array();
}
/**
* Returns the one single instance of this class.
*/
public static function getInstance():TabOrderManager
{
if ( instance == undefined ) instance = new TabOrderManager();
return instance;
}
/**
* Adds a tab order to the tab order manager.
*
* @param The name you are giving this tab order.
* ...
* @param An array of the items in their tabbing order
*/
public function addTabOrder( name:String, tabOrder:Array ):Boolean
{
for ( var i:Number=0; i<tabOrders.length; i++ )
{
if ( tabOrders[i][0] == name ) return false;
}
for ( var i:Number=0; i<tabOrder.length; i++)
{
tabOrder[i].tabEnabled = false;
}
tabOrder.unshift( name );
tabOrders.push( tabOrder );
}
/**
* Removes a tab order
*/
public function removeTabOrder( name:String ):Void
{
for ( var i:Number=0; i<tabOrders.length; i++ )
{
if ( tabOrders[i][0] == name ) tabOrders.splice( i, 1 );
}
}
/**
* Sets the tab order.
*
* @param The name of the tab order configuration you'd like to use.
*/
public function setTabOrder( name:String ):Void
{
releaseCurrent();
for (var i:Number=0; i<tabOrders.length; i++)
{
if ( tabOrders[i][0] == name )
{
for (var j:Number=1; j<tabOrders[i].length; j++)
{
currentTabOrder = tabOrders[i];
tabOrders[i][j].tabEnabled = true;
tabOrders[i][j].tabIndex = j-1;
}
return;
}
}
}
/**
* Removes the current tab order, disabling tabbing on the items.
*/
public function releaseCurrent():Void
{
for ( var i:Number=1; i<currentTabOrder.length; i++)
{
currentTabOrder[i].tabEnabled = false;
}
}
}
And here is the example in the fla... this assumes you have 4 movieclips on the stage named as box(1,2,3 and 4).
ActionScript Code:
import com.createage.accessibility.TabOrderManager;
var tabbing:TabOrderManager = TabOrderManager.getInstance();
var clickTwice:Boolean = false;
tabbing.addTabOrder( "test", [box1, box2, box3, box4] );
tabbing.addTabOrder( "testReverse", [box4, box3, box2, box1] );
tabbing.setTabOrder( "test" );
function onMouseDown()
{
if ( clickTwice )
{
tabbing.setTabOrder( "testReverse" );
}
else
{
tabbing.setTabOrder( "test" );
}
clickTwice = !clickTwice;
}
Please ask if you have any questions.
Take care.
Michael
FileReference Event.COMPLETE Is Useless?
I have a PHP script that uses ftp to upload, the thing is Flash doesn't give a crap if the file has been uplaoded to the server! Since from what I have seen and understand is that all it does is load the data to the PHP script and nothing else, right? Once it is done loading the data to the PHP script then thats its job done! And fires the complete event listener.
So I want to know, how can I determine if the actual file has been uploaded, I guess I have to make use of my PHP script to tell Flash if its done or not? Or is there something else that I can do with Flash to tell me if its actually uploaded the file?
Thanks all
Man, I'm Useless Today... Button Problem
Why are all the buttons I've created now clickable on the stage? Every time I try to select one to edit, or add script, it takes me to the link that it's used for.
Useless Actionscripter Looks To Make MP3 Player...
Hi there, im new to actionscript and flash in general but have recently started a portfolio in flash for a uni project. I really like lees tutoral but am having no luck getting it working.
MY code in my mp3player.as file is...
Code:
//Setup sound object
var s:Sound=new Sound();
s.onSoundComplete=playsong;
s.setVolume(75);
//Array of songs
var sa:Array=new Array();
// currently playing song
var cps:Number=-1;
//position of music
var pos:Number;
// load the songs XML
var xml:XML=new XML();
xml.ignoreWhite=true();
xml.onLoad=function()
{
var nodes:Array=this.firstChild.childNodes;
for(var i=0;i<nodes.length;i++)
{
sa.push(nodes[i].attributes.url);
}
playSong();
}
xml.load("songs.xml");
//Play the MP3 file
function playSong():Void
{
s=newSound();
if(cps==sa.length-1)
{
cps=0;
s.loadSound(sa[cps],true);
}
else
{
s.loadSound(sa[++cps],true);
}
playPause.gotoAndStop('pause');
}
//pauses the music
function pauseIt():Void
{
pos=s.position;
s.stop();
}
//unpauses the music
function unPauseIt():Void
{
s.start(pos/1000);
}
//music controls
//play pause toggle
playPause.onRollOver=function()
{
if(this._currentframe==1) this.gotoAndStop('pauseOver');
else this.gotoAndStop('playOver');
}
playPause.onRollOut=playPause.onReleaseOutside=function()
{
if(this._currentframe==10) this.gotoAndStop('pause');
else this.gotoAndStop('play');
}
playPause.onRelease=function()
{
if(this._currentframe==10)
{
this.gotoAndStop('playOver');
this._parent.pauseit();
}
else
{
this.gotoAndStop('pauseOver');
this._parent.unPauseit();
}
}
//next button
next1.onRollover=function()
{
this.gotoAndStop('nextOver');
}
next1.onRollOut=next.onReleaseOutside=function()
{
this.gotoAndStop('next');
}
next1.onRelease=function()
{
this._parent.playSong();
}
and my songs.xml is
Code:
<?xml version='1.0' encoding='UTF-8'?>
<songs>
<song url='MyloNeedYouTonight.mp3' />
<song url='TouchMe.mp3' />
<song url='AtNight.mp3' />
<song url='LoveStoryVsFinally.mp3' />
<song url='T2Heartbroken.mp3' />
</songs>
I dont get any actionscript errors from flash and the onRollover states work, but no music is played!! i have no idea why??
Any help will be greatly appreciated!!!
Rob
Manipulating MC - Stop Is Useless After Speed Altered
Here's what my problem is:
I've got a movie clip of scrolling icons that needs to change vertical
direction and speed. In my movie clip of icons I have a button that
stops the movie clip from scrolling. Everything works except when the
speed of the movie clip is altered, the stop actions I have in the icon
movie clip become useless.
Here's the code I'm using:
Frame1 of movieclip
g = getProperty ( _root.all.icons, _currentframe );
m = g + (1*x);
if (m<130) {
m = 576;
}
if (m>576) {
m = 130;
}
Frane2 of movieclip
tellTarget ("_root.all.icons") {
gotoAndStop (_root.all.m);
}
Buttons that control speed of _root.all.icons
Up Button
on (press) {
x = 6;
}
on (release) {
x = 2;
}
Down Button
on (press) {
x = -6;
}
on (release) {
x = -2;
}
In my _root.all.icons clip I have a button that stops the icons from
scrolling, but when the speed of the clip is altered, the stop no longer
funtions.
Does anyone have a solution to this or another process they know about?
I appreciate anyone's help in solving this.
Much thanks! Liane
[CS3] Super Useless N00b Chick Seeks HELP
Hi all,
Like the title says, I am a complete newbie at Flash. I very cleverly offered to help out a friend customising a template she bought. In fairness, I've figured out the vast majority of it. There are a few things however, that are making my brain hurt.
The site is uploaded here for testing - http://dddesignco.com/html&swf/
The pink text & logo have been super compressed for some reason. I deselected the compress bit, so I'm not sure why they still look crunchy. Thoughts?The bio page. I can't figure out how to get the text area to resize to accomodate the amount of text. The gallery pages automatically resize, but I have no idea how. Help?The gallery pages - I've worked out how to exchange the images. I can't work out how to add extra ones. When I insert new frames or new keyframes, the new/extra images overflow to the next tab. All the maternity images should be on the 'Dreams' tab. How do I add in extra images and not have the original 5 repeat over and over again?
I've tried everything I can think of and then some. I admit defeat!
All help and advice gratefully received!
Useless Prototype (only Works With A Single Object)
I know it's not the prototype the one to blame but me.
It should work like this: a MC moves a certain amount of pixels, stops and wait for a certain amount of time, it moves again, stops again, and so on.
It works fine with only one MC but when I add more clips its a complete mess.
Here's the code:
PHP Code:
MovieClip.prototype.mover = function(step) {
count = function (clip) {
clip._x += 1;
updateAfterEvent();
if (distance >= step) {
clearInterval(move);
if (distance >= step) {
distance = 0;
}
}
distance++;
};
var move = setInterval(count, 5, this);
};
MovieClip.prototype.stopper = function(step,time) {
clip=this
sarasa = function () {
clip.mover(step);
};
setInterval(sarasa, time);
};
mc1.stopper(100,2000);
//mc2.stopper(100,1500)
//mc3.stopper(150,1000)
Thanks.
Linkage Export To 1st Frame Make Preloader Useless
This makes no sense for Flash to do this.I have movie clips of type "A" that when placed over droptargets will call a attachMovie clip script and place copies of another type of movie clip (call it type "b") onto the same droptarget. The original movie clip "A" then goes back to it's original spot. So, in this way the original movie clip "A" can make unlimited copies of type "B" appear on the stage anywhere the user desires.
OK. This is weird. The type "B" clips have to linked with "Export for ActionScript" option selected. Flash MX has an additional check box that is called "Export in first frame". If I uncheck the "Export in first frame" option then suddenly my movie clips don't work. They won't duplicate when the "attachMovieClip" calls them even though the "Export for ActionScript" option is still on.
That makes just about everything load in my first frame. Since a frame must completely download before appearing, my preloader doesn't even appear until the entire movie is downloaded just about. It just sits there with the background color waiting for all the items associated with frame 1 to load. This makes the preloader USELESS and completely defeats the purpose of having one.
So, if anybody knows why "export in frist frame" must be on OR has a good suggestion on how to get the preloader to show up before the elements of the first frame are loaded.....I'd be grateful. Right now I'm using a work around that has a javascript pop-up window that says loading and closes itself on a timer. Not what I wanted, but at least it lets the user know what's going on. Thanks.
Error #1010: A Term Is Undefined And Has No Properties - Useless Error Message
I hate runtime errors!
ActionScript Code:
TypeError: Error #1010: A term is undefined and has no properties.
at Image/setImage()
at Instructions/preNavigateCallback()
at Instructions/nextSlide()
The issue is that I deleted a movieclip from the stage, but the code referencing that clip was not changed.
Why can't the error say something more useful, for example, including the line number, or the actual "term"?
ActionScript Code:
TypeError: Error #1010: A term is undefined and has no properties.
at "container.guide.visible"
at Image/setImage() : line 214
at Instructions/preNavigateCallback() : line 186
at Instructions/nextSlide() : line 103
Does anyone know why it is so damn vague!? I realise that maybe line numbers probably get lost once compiled, but these kinds of errors always cost me so much debugging time, and are very frustrating - is it impossible to provide the "term" though?.
And does anyone have any good advice on how to avoid them, or track them down with the limited amount of info supplied?
Many thanks,
Dave
_x = _width
hi
i am trying to load a number of external swf's into a parent movie the tricky bit is I want them to line up on the x axis regardless of width (height is the same on all)
so if movie 1 is 300px wide i want movie 2 to be placed at _x=300 the movies loaded in will vary in size so if i can get it to read the ._width of the previous movie, i will only have to update the child swf's
at the moment i have them loading into empty mc's on the stage, but when i set the _x of the clip to the_width of the previous movie it returns 0 (zero)
is it because the script is called before the external movie is loaded, they are only small. if so how do i get round that?
thanks
Can You Specify A Max _width For An Mc?
ok.. here's the situation.. i have a menu that expands and contracts to display each section of the menu (the array goes from 00 - 06) there is a minWidth, maxWidth, and space for the mc's set, at 40, 200, and 4 respectively. Another mc is added to the menu for each menu item. The mc's are set up to expand (maxWidth) on rollover, and return to original (minWidth) on rollOut. There is even a "totalWidth" calculation done to try to control the scale, but it's not working. Problem is sometimes it will work out right, other times, maybe one mc won't reduce all the way to it's minWidth (40) and when you rollover the next the menu pops out further from the original width of the entire menu. it will be easier to understand looking at this:
Code:
| A | B | C | D | E | F | // A selected
| A | B | C | D | E | F | // D selected
| A | B | C | D | E | F | // problem with A returning to orig size when D is selected
So, can i set some sort of MAX TOTAL WIDTH for this that will force it to stay within those bounds? it currently is written like this, but then redefined later in another function:
Code:
function init() {
space = 4;
easingSpeed = 3.2;
minWidth = 40;
maxWidth = 200;
totalWidth = ((items_arr.length-1)*minWidth)+maxWidth+(items_arr.length-1)*space;
}
// more code etc etc
// then later in the script to control the mc growing on rollOver it's this:
totalWidth = maxWidth+(items_arr.length)*(minWidth+space)-space;
can i somehow force them to ALWAYS return to the min width size? (i can post more code if you need it.. i just figured if i could define some sort of ABSOLUTE width of the whole menu, i could constrain it into a "box" and force the values to return to set values. i tried moving
space = 4;
easingSpeed = 3.2; etc
out of init() and used var space = 4, var easingSpeed - 3.2 etc but hthat didn't work either.
any thoughts?
_width Help
I'm using the following code to loop through images in an xml file fading one image in as the other is fading out. This is only a portion of the code. But basically if the user wants there to be a description of the image, then it should be displayed below the image. From the code I am able to trace out the height of the loaded image and hold it in the var imgHeight, but when I place that var as my "Y" value of the createTextField, it doesn't recognize it. Why?
Code:
min = 0;
max = 100;
fadeAmount = fade;
img1Container = true;
function updateImage(newImage) {
_root.textDrag.removeMovieClip();
if(hasLinks){
linkLayer.onRelease = function(){
linkLayer.getURL(newImage.attributes.link, "");
}
}
imagePath = newImage.attributes.jpgURL;
description.text = newImage.attributes.desc;
if(img1Container){
holder = img1;
img1Container = false;
}else{
holder = img2;
img1Container = true;
}
loadMovie(imagePath, holder);
if(hasDesc){
var imgHeight:Number = holder._height;
trace(imgHeight);
//define the format of the text
var descFormat = new TextFormat();
descFormat.color = 0x000000;
descFormat.font = "Trebuchet MS";
descFormat.size = 14;
//create the text field
_root.createTextField("description", this.getNextHighestDepth(), 0, imgHeight, 300, 25);
//apply the text format to the textfield
description.setNewTextFormat(descFormat);
description.selectable = false;
}
holder._alpha = min;
fadeInInt = setInterval(fadeIn, 25, holder);
nextImage = currentImage.nextSibling;
//trace(nextImage);
if(nextImage == null){
currentImage = firstImage;
}else{
currentImage = nextImage;
}
}
Also, the first image being loaded always displays 0 as the height, but then the next time the same first image is loaded, it displays the correct height. Why is this?
Thanks for any help.
_width?
If I made a library instance of a straight line and put it on the stage and set the width in the properties box to be 100 -- why does Flash display the _width to be a different value when I trace the width in actionscript -- 110.8 in this example???? Furthermore when i go about rotating the line in its onClipEvent(enterFrame), it's _width is constantly changing going from 0 back to 110.8?? I'm not doing any kind of transformation other than incrementing the _rotational value of the line. Does anyone know what's going on here?
Please someone help me -- it's driving me crazy..
_height & _width
Hi all
I am trying to return the size of my movie using _height and _width properties, but this returns the size of the MC I have placed on the stage. Does anyone know how I can return the actual movie size?
Cheers
Mark
|