Action Script Ref Code Ques
Hello i keep getting this this action script error when i attempt to render this swf could some one explain what this error message means ......i am not sure what the variables are looking for ....... the version is Flash 8 - the action script is below and the error message is below that.......
#include "lmc_tween.as" //classes are loaded on this frame var state:com.collection.State = new com.collection.State(this); // start program var main:com.collection.Main = new com.collection.Main(this) // bg_img.tween("_alpha",100,1,"linear",.5) stop()
Error message (below)
**Error** Scene=Scene 1, layer=actions, frame=5:Line 1: Error opening include file lmc_tween.as: File not found. #include "lmc_tween.as"
**Error** Scene=Scene 1, layer=actions, frame=5:Line 3: The class or interface 'com.collection.State' could not be loaded. var state:com.collection.State = new com.collection.State(this);
**Error** Scene=Scene 1, layer=actions, frame=5:Line 5: The class or interface 'com.collection.Main' could not be loaded. var main:com.collection.Main = new com.collection.Main(this)
Total ActionScript Errors: 3 Reported Errors: 3
FlashKit > Flash Help > Flash ActionScript
Posted on: 09-17-2007, 02:36 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Action Script Ref Code Ques 2.0
Hello please see this link it is a follow up to the thread i created before....i am stil trying to figure this error out when i generate the flash swf it works but not properly... below is a link to what the swf looks like there are buttons that should show and i get this message (shown below) in the flash error box that says (output) when i hit ctrl+enter to generate the swf.... any suggestions...?
b1,b2,lgText,redText,arrow,a:link,a:hover
yo
http://www.amjaydesign.com/mainCol.html
http://board.flashkit.com/board/showthread.php?t=744878
Html Code Inside Flash Ques
I have a client who wants me too put some html inside the flash actionscript. He's not sure it will work and I'm not sure if it's possible or how to do it. Here's the code any suggestions thanks
<form action="/gift/save/1234" enctype="multipart/form-data"
method="post">
<input name="file" type="file" />
</form>
Nav Ques
Hey guys I seem to remember a thread regarding how to make this kinda of NAV :
http://dopepope.com/ntps/Build_onff/
Anyone remember the thread or have a link on a tutorial to dup that kind of load jpg and have the window resize automatically...thanks all
_parent. Ques
im trying to load an external jpg. and the file name of this jpg is the name of the mc 2 levels above the command.
if u dont understand this is thi code im trying to use
Code:
x = _parent._parent._name;
loadMovieNum("x".jpg, 1);
i also tried putting th eparent crap in the load move itself like this
Code:
loadMovieNum("_parent._parent._name".jpg, 1);
and its still not working. any one able to give some advice
AttachMovie Ques
Hi -
I'm using the code below to bring mcs from the Library to the stage. It works fine until I tried to add the x,y at the end.
I thought there was a way to include _x and _y coordinates to the same statement as the attactMovie. Is there?
TIA the correct way to accomplish this.
jl
Attach Code
mc_btn2.btn2.onRelease = function():Void {
attachMovie("Q2WithGame","Q2Game",this.getNextHighestDepth,[_x=45,_y=110]);
};
Simple AS 1.0 Ques
AS 1.0
I have this code in a keyframe on the main timeline:
var score = 0;
if (score == 2500){trace("winner")}
Othe stage in the maintimeline i have a dynamic text field I labeled "score" in the var box. The instance name is "pts" but i wasnt sure if i needed an instance name anyway here. The score box works fine as far as keeping score but when it reaches 2500, I dont get my trace. What am I missing? Thanks
-Chris
Stupid Ques
hello new be ere (welsh) i got a prob wanderin if some1 could help im tryin to get a news page that updates ive got this off yahoo
this
so now tryin to use it but flash does ntlike it im prob doin some thing stupidly wrong now on the verge of not botherin
PLEASE HELP
Attaching MC Ques
hi.. anyone out there can give me a tutorial which teaches attaching a MC to another MC?? urgent..
Stupid Ques
hello new be ere (welsh) i got a prob wanderin if some1 could help im tryin to get a news page that updates ive got this off yahoo
this
so now tryin to use it but flash does ntlike it im prob doin some thing stupidly wrong now on the verge of not botherin
PLEASE HELP
Flash Ques
please can you explane me how can I make this file like on this site:
http://www.t-s-k-b.com .You go on this site and press SAKUBA WORKS and then button Painting/Drawing
I would like to make a picture gallery like in Painting/Drawing: So how I can make when the mause on the button to show small image of the picture and when I press the image to open the picture how is on the site(not in a new window)?
Please tell give me advice how could I make it!
thank you
Another Loading Ques
Is it possible to make the movie load let's say... only the 1st 2 frames of movie that has 8?
Button Ques
Ok real dumb ques..I have this animation..u can dl it from here: www.zeroxposur.com/test/nav.fla
So what I want to do is have 5 buttons fade in ..onto the bar as it finishes its animation..but I dont know how to do it.. Can anyone point me in the right direction. Thanks
Easy AS Ques.
ok so I have a flash doc..theres a an MC called target on mainstage that has the entite site in it (doing a fullscreen centered website)..now I have MC nav buttons on the stage (inside target). Inside one of the nav buttons I have a line of AS that says
ActionScript Code:
this.onRelease = function(){
_root.target.loadMovie("bioresume.swf", "loader");
}
Now im not sure If im doing that right..but what i want to happen is; after u release the button, load the ext swf into the empty MC called "loader". But what seems to be happening is it loads the ext swf but everything else on the site disappears. See I originally had this as my AS cause i thought this made sense but it ends up not doing anything:
ActionScript Code:
this.onRelease = function(){
loadMovie("bioresume.swf", "loader");
}
So if anyone knows what I did wrong, much appreciation. Heres the site link if u want a visual:
www.josephsernio.com/test
Easy As Ques.
Ok for some reason the end of this code doesnt work.. on release, i want it to take me to frame 2..and it wont...btw this a movie clip that has button properties through AS:
stop();
this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}
this.onRollOver = function(){
rewind = false;
play();
}
this.onRollOut = function(){
rewind = true;
}
this.onRelease = function(){
gotoAndStop(2);
}
MC Loader As Ques.
im working with the moviecliploader AS..so a button loads an ext SWF and also has a percentage loader .. so on my mainstage i have a loader mc (instance name "loader")and a holder mc (instance name "holder")..heres my AS on the main timeline:
var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();
mclL.onLoadProgress = function(target,loaded,total) {
loader.percent.text = Math.round((loaded/total) * 100) + "%";
}
mclL.onLoadInit = function() {
loader._visible = false;
loader.percent.text = "";
}
mcl.addListener(mclL);
Now i have another MC that houses about 20 or so buttons..so within the buttons MC i have say this for one of the buttons:
b4sub.onRelease = function() {
_root.loader._visible = true;
_root.mcl.loadClip("LevisCampaign.swf",holder);
And unfortunetly it doesnt to load the ext. swf..did I code the _root incorrectly?
Thanks for your help.
Fscommand Ques
Hi all, I was working with fscommand, when it struck me what FSCOMMAND stands for.
"Future Splash Command"
Can anybody confirm this, or am I mad, lol
Later
ORANGE900
LoadVariables Button Ques
Hello all. I have this code attached to a button calling up a different text file to a dynamic text field and it works fine, except I'm having to hit the button "twice" for it to work. Can't figure out why. Can someone enlighten me please?
code:
on (release) {
scrolltext = scrolltext1;
loadVariables ("scrolltext1.txt", scrolltext1);
}
Thanks in advance
Easy - Pong AI Ques.
Ok just to see if I could do it(never really got into game programming) I tried to make a pong game everything works so far but I have a problem with this:
Flash code:
PHP Code:
onClipEvent(enterFrame) {
if(_global.cspeed == 0) {
}else{
if (this._y != _root.ball._y){
if(_root.ball._y < this._y){
this._y -= _global.cspeed;
}else if(_root.ball._y > this._y){
this._y += _global.cspeed;
}else{
this._y = this._y;
}
}
}
}
The problem is that instead of moving smoothly up the screen it looks like it s shaking up and down really quickly, but I would like it to be smooth.
Please help.
Movie Clip Ques
Hey i just started doing flash yesterday and i am doing a text fade
I made the motion tween and and everything and when i go to control and play everything is smooth but when i go to test movie nothing it just stays the same and doesnt fade :> plz help me
Movie Clip Ques
Hey i just started doing flash yesterday and i am doing a text fade
I made the motion tween and and everything and when i go to control and play everything is smooth but when i go to test movie nothing it just stays the same and doesnt fade :> plz help me
Quick Mask Ques
Im sure this is an easy one.. on the foofighters website http://www.foofighters.com When U click a button that flourish/swashy graphic looks like it is unwinding or growing rather. I would like to get the same effect.. Its obviously a mask of some sort. I know who to mask, im just figuring its a mask that is animated somehow. Anyone have an idea? Appreciate any insight into this. Peace
-R
Quick Actionscript Ques.
Ok so im building a portfolio website and basically if you click on the art image it goes tothe next art image..I have it set up so the art images are buttons and when u click it, it is coded to goto next scene..On one scene however the art image is a movieclip (fading effect)...now how do you write the actionscript so if you click on the movieclip it goes to the next scene? I dk im right but...my guess is to put the MC within a button symbol? But I dk. Thanks guys.
UI Text Input Ques.
Ok so Im making a form in flashmx2004..I drag out onto the stage the UI compnent textinput box..now I want to make this box multiline but it doesnt give me the option to do so. Do I have to make input boxes in a different way?
Motion Guide Ques
Hi all,
Is it possible to create a motion guide, so the object connected to the motion guide is always in the centre of the screen.
What I mean is, if we were trying to go from point A to point B
we could see the full journey of the object travelling along motion guide in the centre of the screen.
A-------->--------->-------->------B
The sort of thing I mean is included, but with no motion guide instead, the car remains in the centre of screen and is able to move around the track which in turns moves the the track below.
Thanks for your time, sorry for the broken language. Hope you can help.
--------------
FLA = MM2004
<> QUICK QUES RE:Positioning After Dupe
Hi Im using a while loop and the dupliacteMovieClip() to dupe a certain number of my Mc's. I want to postion each duped Mc after its created with setProperty but I cant figure out how to do this within the same loop.
It complains in output box:
Symbol=playlist_Mc, Layer=Layer 2, Frame=1: Line 9: Expected a field name after '.' operator.setProperty(_root.playlist."box" + count, _y, vertpos);
Obviously I cant do the <"box" + count> bit, but how else can i do it?
(see code below)
Code:
onClipEvent(load){
var vertpos = 46;
var count = 0;
//create
while(count!=4)
{
duplicateMovieClip(_root.playlist.box, "box" + count, 1);
-->this doesnt work//setProperty(_root.playlist."box" + count, _y, vertpos);
trace(count);
count++;
}
//position
}
-Rich
Pleez Help With Random Keyframe Ques.
I have four different movie clips on four different keyframes (2-5) the first key frame has a clip with an invisible button over it. WHat I would like to achieve is onMouseover of the button in the first frame......I would like the playhead to randomly gotoAndStop on of the other frames (2-5). To give the illusion of random movement. The on mouseout return to the first keyframe. any help greatly appreciated....either a .fla I can study or some AS would be great.
Probably Simple LoadMovie Ques. For JPEGs
I have a target MC that I want to load some JPG's into in my Flash Movie. The Target MC's dimensions are 650x500px. The JPG's are the same. When I attempt to load them, I can notice that something has changed in the tone of the movie clip (I had the target MC a grey color then that color disappears) but the JPG does not load.
I tried a smaller JPG, like 1/4 the size, and it loaded OK. ANyone have a suggestion?
Simple Ques About Blue Border Box
I'm using flash 8. When you draw something or import a picture flash 8 puts the blue border box around it. Well mine is gone. If I draw something and click on it it is a broken shape. How do I get the blue border box back?thanks
Loading Clips Into Levels? -quick Ques
Hi, I need a quick bit of code or at least somebody to give me an idea on how to actually have a clip load itelf into a specific level depending on the value of a variable. I want to do this as my duplicateMovieClip() code is putting MC's on higher levels than other elements (other Mc's) in my movie, and one of these elements in perticular needs to be the 'highest'.
I tried using setProperty() as below but it doesnt work, flash complains (I gather it doesnt consider '_level' as a property?)
Code:
setProperty(need2BHighest_Mc, _level, highestLevel);
Any help appreciated
How Do I Add Action Code In MX?
I'm trying to add a action code to my buttom to get it to go to a link and the code I'm trying to add is:
on (release) {
getURL ("http://geocities.com/dreamtheatermp/", "_blank");
}
but when I try to add code, it wants me to pick actions from a list, I can't find anywhere to jsut add the code as is.
Is This Right Action Code
Hi not sure if this is right. get loads of errors please help thanks
action = "send";
loadVariablesNum (mailform, 0, "POST");
gotoAndPlay ("wait");
//if it was successfule gotoAndPlay ("confirmed")
//}else{ gotoAndPLay try again ..
if(success){
//
}
stop ();
Action Code
Hello to all.
I am trying to make a page open in a new page from home page when you click on the Picture button, i want to open in a new page (via another link). So, when you open that page, I want to add only one button saying "Close the window". So, what should the action codes be for the button in order when clicked on it to close the window instead of clicking on the X.
Thanks!
ACTION CODE
HI
Im trying to get a full screen to open, can someone tell me how to write this code??
thank you
on (release) {
fscommand ("fullscreen", "true");
}
on (release) {
getURL ("javascript:window.open('http:/window77.html','Welcome_To_FlashKit','width=1800,height=1800,top='+((screen.availHeight/2)-(" add varHeight/2 add "))+',left='+((screen.availWidth/2)-(" add varWidth/2 add "))); void(0);");
}
Asp Code In Action Script
I am trying to attach the following code to a mouse over action in flash
--------------
shopping/default.asp?category=<% =server.urlencode("special offers") %>&categoryid=41&transfor=<% =transfor %>
--------------
but when I preview the movie, i get a html text link on the page diplaying:
--------------
&categoryid=41&transfor=<% =transfor %>
--------------
the first part of the code is in the mouse over, the second part appears as html on the page.
any ideas please.
cheers.
Action Script Code
hi there
Can somebody please suggest me some best action script site that have some advanced action script examples.
thanks
Help With Action-script (code).
Hi
I am setting up a website and I am having probelms accessing content with a pop-up menu.
I have a menu bar at the top which i have converted to a movie clip, so when i scroll over 2 options another bar drops beneath the main menu.
My main menu is in a movie clip called menu_mc.
My sub menu is the located in a group of frames named Profile.
The button in my submenu i want to access is about_btn.
I want to attach my content called txtabout_mc.
Hope this is enough information. If you need any more then i can provide it. Any help would be appreciated
Example Code For A Simple Action?
We're pretty much neophytes when it comes to AS and would like to build a UI very similar to this IKEA example w/o having to build dozens of scenes, etc.
Can anyone suggest a simple combination of buttons, scenes, layers and AS to emulate this behavior of mouseover - hold and onClick to a URL?
Example:
IKEA Ad
Oh, and somehow integrating the text field with either XML or flat files.
Thanks much
Edited: 11/22/2006 at 05:52:23 PM by Alaskakaz
Help W/ Action Script Code?
hello -
i'm trying to insert some simple javascript into a flash file to test how it works.
within the html file, i have this code:
<script language="JavaScript">
function mycallback(value) {
alert("hello world! - " + value);
}
</script>
what should my actionscript code look like in my flash file?
currently i have a link called - <a href="" onClick="mycallback('creative'); return false;">
i want to create a button in flash w/ the code above.
here is just a html version of how i want it to work:
http://www.dkwong.com/example_js.html
thanks!
Please Help Me With My Action Script Code.
Hi everyone this is my first post to Kirupa, I have been busy trying to learn as much as I can about Action Script, Flash and XML before I posted, I couldn't find anywhere on how to get your code in a little box when posting, so if someone could give me a pointer on that fist I will clear up this messy post!
My real question is:
I have designed the following gallery:
What I would like is for an image with a photoshopped glass bar to appear when the user clicks on the "i" button in the bottom right. Like this:
So the base code I have used is from the Kirupa Thumbnail Tutorial. I have already modified it to use links, but now I'm a bit stumped as I'm new to action script. I have added in the node information for an alternative image at the top, but don't know how to write the action script to change the photo on a button release.
The information button is named: "info", but I don't know where and what action script to use to switch the main photo, to it's alternative with the information pane.
Here is my action script so far:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
info = [];
description = [];
thumbnails = [];
links = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
info[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
links[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
picture.onRelease = function() {
getURL(links[p], "_blank");
};
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function thumbNailScroller() {
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 9;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._heig ht)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=(hit_left._x+40)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
and the xml Data file:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>1.jpg</image>
<info>1i.jpg</info>
<caption>anina</caption>
<thumbnail>1t.jpg</thumbnail>
<link>http://www.yahoo.com</link>
</pic>
<pic>
<image>2.jpg</image>
<info>2i.jpg</info>
<caption>anina_02</caption>
<thumbnail>2t.jpg</thumbnail>
<link></link>
</pic>
<pic>
<image>3.jpg</image>
<info>3i.jpg</info>
<caption>archi_01</caption>
<thumbnail>3t.jpg</thumbnail>
<link></link>
</pic>
<pic>
<image>4.jpg</image>
<info>4i.jpg</info>
<caption>suitcase</caption>
<thumbnail>4t.jpg</thumbnail>
<link></link>
</pic>
</images>
Please note that the alternative version of the file has an i after the name.
Thank you so much for your help, always makes me smile that there are so many helpful people out there,
Ben
Edit Code In Object Action?
Hello, I'm not usually an hands-on flash artist, but because I'm out of management work, at the moment, I'm forced into trying to make an honest living.
Here's my problem: I've downloaded an (fla) from flash-kit and began to rework it, BUT, for some strange reason (Most Likely Me), EVEN In Expert Mode, I Can Not Seem To Edit the Action Scrip (every thing is Gray). So Far, I have Set the Expert Mode in the Preferences AND in the drop down Menu in the upper right-hand corner of the Action Script Window to now avail. Also it keeps telling me that the movie is protected, and again, even in preference I can not seem to find away to edit this fla. file! If anyone have any suggestion, short of hair-carry, I would deeply appreciate it.
I'm on the Mac.
Please Help someone A.S.A.P.!!!
Understanding Action Script Code
--lol, it might be easiest to read the help file! sorry guys and gals
(I'm using Flash 5, and I am a flash novice)
I have some programming experience already...
Ok I have learned most of C++(all but graphics), some Pascal(basic graphics), and BASIC, I learned last but fast.
So I think I'm pretty smart, at least at programming languages.
Now I'm trying to understand action script code, but I don't know if it would be easier to try and just look at written code, or look through the tutorials on actionscript... It seems most of the tutorials are for people who have had no programming experience before. So basically I was wondering if there are any tutorials with code breakdown, where they decribe it line by line, and what everything does, rather than saying just what the whole program does.
OR would it be easier to read about the basic types in code, like data types, primative and reference, and objects, and then learn from other's coding?
Fortunately I can understand WHAT they are doing, I just don't know what symbols flash uses; For Example: With methods/functions; To get the hour with time, the method returns the number of the hour with the method "getHour()". And then with objects, (like class objects in C++), it goes "this.getHour()"
So what do you think would be easier:
Reading Code or Searching for Tutorials?
Thanks, and Happy New Year, Woo HOO!
Rollout Action Help (Flash 4 Code)
I'm building a navigation with a rollover action. The strip is only 40 pixels high so it makes it very easy for buttons to get stuck on the rollover when the user jerks the mouse out of the flash window. Is there any way for flash to check every few seconds to see if the mouse is still in the clip? This has to be in flash 4 code. Thanks for any help.
Action Script Code To Solve
The following link shows you a rotating menu with 4 items
http://www.mumdjin.net/rotating_menu.swf
the code is the following, with a locating value for each item :
// standard Cartesian co-ordinate system
var YCoords = [0, 0, 0, 0];
var XCoords = [50, 50, -50, -50];
var ZCoords = [-50, 50, 50, -50];
How could I possible do to insert a fifth or a sixth ball?
Thanks to anyone who could help me!!!
Setting Action To Buttons Via Code
Hi there.
I'm working on a drop menu. Since there are few menus with differnt number of buttons I'm Duplicating mcs with buttons inside. I like to set the right action, the right event for eche one of them.
Logiclly it suppose to be someting like:
mc_1.button_2.onClipEvent(release)
{do_something()}
But its not! How can I set action to buttons via code ?
Query About Action Script Code
I've been trying to figure out how to make these sliding screens work. I understand that screens are behind a mask - and have that portion down. The part I don't understand is when a screen is down and you click another button, the current screen goes up before the new screen comes down. I'm trying to figure out the code that enables this action.
The way I see it in my mind - a scene is built for each screen. The animation stops halfway through the animation. When another button is selected - the current animation runs and completes before the next scene is played.
Here's the website I'm talking about: http://alpha.playfastforward.com/
Any suggestions?
Thanks,
fla_gman
POP UP Code From Action Script... Standalone.
Hello, does anyone know a good way to create a Full Screen browser pop up from a stand alone flash projector?
Or, does anyone one know how to send data and have php Write to a file without using a browser?
--------------------------------------
Either of these should help me out. i need to write to a php file from the following script, however it is being called from a stand alone flash projector. This code will not work unless in a browser. So i either need to go full screen with a browser, or write to php without a browser.
code:
send_btn.onRelease = function() {
input_xml.parseXML("<edit> new text </edit>");
input_xml.firstChild.firstChild.nodeValue = input_txt.text;
input_xml.xmlDecl = "";
// declaration duplication bug
input_xml.sendAndLoad(server_file, output_xml);
output_txt.text = "Loading...";
};
|