Simple Date() Issue...
ok... here's the code: Code: Date.prototype.getFullDate = function() { weekday = new Array('Sunday', 'Monday', 'Tuessday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); month = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); tmpDate = new Date(); day = weekday[tmpDate.getDay()]; monthname = month[tmpDate.getMonth()]; year = tmpDate.getFullYear(); date = tmpDate.getDate(); if (length(date) == 1) { date = " "+date; } switch (date.charAt(1)) { case 1 : suff = "st"; break; case 2 : suff = "nd"; break; case 3: suff = "rd"; break; default : suff = "th"; } return day+", "+monthname+" "+date+suff+", "+year;
};
currDate = new Date(); trace(currDate.getFullDate());
ok.. here's the problem : the date suffix returned is ALWAYS 'th'... today is the 23rd... but i keep getting the 23th. What's wrong with this?.. why isn't the switch working properly?
I even tried to use 'if' statements to check and still get the same result... the 23th.
any help or thoughts?....
thx
FlashKit > Flash Help > Flash ActionScript
Posted on: 02-23-2006, 07:46 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Date Object Issue - Wtf ?
Code:
someVar = new Date (2003, 2, 29);
someVar2 = new Date (2003, 2, 29);
trace("someVar " + someVar);
trace("someVar2 " + someVar2);
trace (someVar == someVar2);
Why does this return False? It should return True imho.
Thanks for your time.
Date Time Issue
I am having an issue with this script it is putting time in military and also is a day ahead of what it should show. Help please.
Date / Login Issue
Hi - I am struggling with a script that is working perfectly except for December each year.. Here is the script:
-------------------------------------------------
if (currentMonth == "October" || currentMonth == "November" || currentMonth == "December") {
if (_root.mylogin == "2537") {
gotoAndPlay("Scene 2", 1);
} else {
logintimes = (logintimes+1);
_root.mylogin = "";
trace(logintimes);
if (logintimes == 3) {
gotoAndStop("Scene 3", 1);
} else {
_root.mylogin = "";
_root.errorlogin.gotoAndStop("Scene 1", 1);
}
--------------------------------------------------------------------------------------------
It seems very strange to me that each other month of the year works fine.. I gone over an over it and cant see anything off in the code around "December".. Any ideas out there?
Much appreciated
Chris
Flex Date Field Issue
I am not sure if it is only me. I have try this serveral times with date field component.
Here is my code:
<mx:Script>
<![CDATA[
private function init():void
{
text1.text = dateField.selectedDate.fullYear
+ "/" + dateField.selectedDate.month + "/" + dateField.selectedDate.date;
}
]]>
</mx:Script>
<mx:Text id="text1" />
<mxateField id="dateField" close="init();" formatString="YYYY/MM/DD"/>
after the date field closed, the text show the right YEAR and DATE, but not the right MONTH. If I choose January, the MONTH will actually becomes to ZERO.
Please, could anyone tell me why!
Thank you so much.
Have a good festive season.
Webservice Date Type Issue
I'm having some difficulties using a date type as argument in a flex 2 soap webservice:
wsdl expects this : <element name="endDate" type="date"/>
actionscript 3 example :
ActionScript Code:
var sd : Date = new Date(2006, 11, 2);
webservice.method('arg1', 'arg2', sd, 'arg4')
This return an IO ERROR. When I sniff the request i noticed something strange : <endDate>2006-11-02Z<endDate>
What's the 'Z' doing there?
Flash Date/Time Issue From .NET Web Service
Environment
Flash 8
ActionScript
C# Web Service
Windows 2003
First of all I'm not a Flash or .NET programmer but can solicit more information from our engineers if necessary. We have Flash application that is calling a web service and receiving a person object. The Flash application takes the person object and without modification passes it back to another web service. The problem is the Flash program receives the object just fine, but when the object is passed back a date/time field is displaying NaN in the XML that we are sniffing off the wire. Below are the two examples of the XML. Note the examples have been truncated to hide information that may not be good to post here. Note the differences between Birthday.
Flash call TCP stream:
<TestWebService xmlns="http://jenkon.com/jweb/webservices">
<person>
<WebAccessLevel>B</WebAccessLevel>
<InternalDistId>18384001</InternalDistId>
<ExternalDistId>9830923</ExternalDistId>
<WebEmployeeId>111</WebEmployeeId>
<SponsorInternalId>24059001</SponsorInternalId>
<SponsorExternalId>9961435</SponsorExternalId>
<OriginalSponsorInternalId>24059001</OriginalSponsorInternalId>
<OriginalSponsorExternalId>9961435</OriginalSponsorExternalId>
<Birthday>NaN-NaN-NaNTNaN:NaN:NaN.NaNZ</Birthday>
<MailingAddress>
<Address1>2316 GLENBROOK WAY</Address1>
Windows Call TCP:
<TestWebService xmlns="http://jenkon.com/jweb/webservices">
<person><WebAccessLevel>B</WebAccessLevel>
<InternalDistId>18384001</InternalDistId>
<ExternalDistId>9830923</ExternalDistId>
<WebEmployeeId>111</WebEmployeeId>
<SponsorInternalId>24059001</SponsorInternalId>
<SponsorExternalId>9961435</SponsorExternalId>
<OriginalSponsorInternalId>24059001</OriginalSponsorInternalId>
<OriginalSponsorExternalId>9961435</OriginalSponsorExternalId>
<Birthday>1948-09-11T00:00:00</Birthday>
<MailingAddress>
<Address1>2316 GLENBROOK WAY</Address1><Address2 /><Street><string>2316 GLENBROOK WAY</string><string /></Street>
Does anyone have any direction they can give us. The Flash contractor is not sure on what to do. We are the C# Web Service providers. I've seen some posting on XFORM that say if a function receives and invalid Date Time then a NaN will be responded. I'm sure XFORM does not have anything to do with Flash, but it is the only thing I've been able to find that is the closest fit based on the Googling I've been doing. Our C# guys can make this work by converting our date/times to strings but we don't want to go down this route. Any help would be greatly appreciated. The mutual client for this is behind schedule on rolling out a web site to their field.
Glenn Batson
Development Manager
Jenkon
wabatson@comcast.net
Flash Remoting With ColdFusion 8 Date Issue
This is a strange one.
I have a website that displays event data pulled from MSSQL 2005 via ColdFusion 8 and then is rendered in an AS3 flash application via a remoting call. I use a CFC to create an Array to pass data to the flash application.
Here's the weird part. It doesn't seem to matter which browser or version of the flash player you are using but one user will be provided a list of events with the correct start and end date, and then another person on a different PC will get the same event information but with different dates, one day less exactly???? Keep in mind these machines have identical configurations.
I do not understand how this could be happening.
The MSSSQL 2005 field is a datetime field. But this still does not explain that the dates drop one day.
Any assistance here would be great.
Asp Simple Date Help
I need to load an ASP page with this code:
xvar=<%=date%>
in my flash movie all I get in a dynamic text box is:
<date
What the #@&#*@&#*@#&!!!
Can anyone help???
Simple Date?
Hello,
I need a bit of help here, I want to place a graphic at the top of my page that displays the date in this format :
ie, 31.07.2003
It's just going to be text. I've downloaded a tutorial from here before that explains how to do the date and time, but when I've tried changing the code I seem to mess it up
I'd be really grateful for any help you can give me. It would be great if the code can be contained within a movie clip or something so that I don't have to add it to the code for each scene, if that's possible??
Thanks, Sarah.
//Simple Date By Asp Tutorial
Here is the ASP tutorial:
PART1-------------------------
1)make a Flash movie w/ a MC named date
2)inside the MC make two action frames
1st frame action= loadVariables("http://www.sdginteractive.com/date.asp", "");
2nd frame action= stop();
3)make a 2nd layer w/ a dynamic text box spanning across both layers name it date if you like, doesnt matter though.
PART2---------------------------
1)opem up note pad and paste the followin asp code
date=<%=formatdatetime(now(),vblongdate)%>
2) save the document as date.asp
3) upload the .asp page to your server in the same place you have the loadvariable URL!! I have the zip for download here>>>>
http://www.sdginteractive.com/date.zip
Simple Date Question
HI!
Anyone knows how to pass from a date string (Ex: "10/05/2002"). To an actual DATE Object?, do I have to parse a string manually or there is a way?
Thanks
Simple Date Error
I am simply trying to write the day and month in a dynamic text box. It should be in the following format "Friday, September, 2nd". I have built an array for the last part of the date so instead of the date being 3 the date would 3rd. But Flash claims that there is an error with line 7.
PHP Code:
var today_date:Date = new Date();
var dayOfWeek_array:Array = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var monthNames_array:Array = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var stnd_array:Array = new Array ("st", "nd", "rd", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th", "th", "th", "st");
var mon_str:String = monthNames_array[today_date.getMonth()];
var day_str:String = dayOfWeek_array[today_date.getDay()];
//The Error happens below
var st_day:String = stnd _array[today_date.getDate()];
status.text = day_str+", "+mon_str+", "+today_date.getDate()+"nd "+st_day;
I have a dynamic text box on my document with the instance name of "status". I am using Flash MX 2004 Professional.
I cant get it working!!
Help is greatly appreciated
P.S This is actionscript not PHP code
Simple Date (month) Question...
hi...i know i've seen this question in here before (somewhere), but can't seem to find it now that i need it.
here's the deal...
my month is coming back 1 month behind (so it reads as 7 instead of 8)...i know why, but i can't figure out how to add +1 to it...i'm new to the whole variable thing in flash, so if anyone can help i'd appreciate it
thanks
Simple Software Protection Through Date Check
Dear all,
Flash MX
I have a standalone .EXE that I want to protect with a simple date protection:
IF DATE > 2005 THEN QUIT
Can somebody help me with the correct Action Script for this?
(Of course I realize this protection method is far from secure, I just want to discourage usage after a certain date).
Many thanks for sharing knowledge,
Carfi
Convert RSS2 Date Format To Flash Date() Object
How can I take an RFC 822 (RSS 2) formatted string, and read it into a Flash MX Date() object. Flash does'nt like the format.
I have a function that will break the string apart the long way but is there an easier way to accomplish this - I can't believe flash would'nt have it built in like .NET or ColdFusion.
Thanks!
Aaron
PLEASE HELP - Very Simple Issue
I need to know how to make a button within a movie go to a frame in the parent scene.
More or less, I have 1 scene and there are 2 frames in that scene. I have a movie in scene 1, and within that movie there is a button. I need to know how to make that button clickthru to frame 2 of scene 1.
PLEASE HELP I'm really stuck on what is probably a simple solution.
Thanks,
Walt
Simple Issue
how does a function access a variable outside its class? because Flash 8 keeps throwing errors at me when I try to access a variable in my timeline from my .as class file?
boombanguk
Please Help With This Simple Issue
I have a simple problem but dont know how to solve after many searches...
I have 4 buttons, say Button A, Button B, Button X and Button Z.
I want to replace or swap Button X with Button Z when I click on Button A and Swap button Z with Button X with I click on Button B.
I dont want to use timeline. I want to use some kind of swap or replace function or any other method to do this.
Like:
On (release)
{
Button X = Button Z
}
Kindly, help, I will be really gratefull.
Thank you in advance.
Haider
Date Specific Content/dynamic Text/Get Date
Hello,
I am trying to build a page where there is Date specific content, i.e. after a certain date the information becomes obsolete and will need to be replaced with new information.
Does anyone have any idea how I can go about doing this?
Thanks,
Kris
Comapreing A Datefield Selected Date To Current Date
i have a made a small swf which checks the seleted date on the datefield component is passed current date or not...
i have a function get the day associated with it...
stop();
function getDayName(num) {
switch (num) {
case 0 :
return "Sunday";
break;
case 1 :
return "Monday";
break;
case 2 :
return "Tuesday";
break;
case 3 :
return "Wednesday";
break;
case 4 :
return "Thursday";
break;
case 5 :
return "Friday";
break;
case 6 :
return "Saturday";
break;
}
}
today = new Date();
today = getDayName(today.getDay())+" "+today.getMonth()+" "+today.getDate()+" 00:00:00 GMT+06000 "+today.getFullYear();
on relese event of the button...
dateField is named - arr_date
on (release) {
_global.selday = _root.arr_date.selectedDate;
_global.selday2 = getDayName(_global.selday.getDay())+" "+_global.selday.getMonth()+" "+_global.selday.getDate()+" 00:00:00 GMT+06000 "+_global.selday.getFullYear();
res = (selday2<today);
_root.dis = res;
}
the thing is sometimes res says "TRUE" for future dates also.
download fla here
can anyone help on this.
Thanks
Display Date And Day With Computing Three Days From The Date With Certain Restriction
Hi
i have a code that display date and day from your local machine.
Here it is:
================================================== ===========
function howlong(arg) {
if (length(arg) == 1) {
arg = "0"+arg;
return arg;
} else {
arg = arg;
return arg;
}
}
myDate = new Date();
//hr = howlong(String(myDate.getHours()));
//mnt = howlong(String(myDate.getMinutes()));
daytext = myDate.getDay();
//daytext = daytext+3;
dd = myDate.getDate();
//dd = dd+3;
mm = myDate.getMonth();
//yyyy = myDate.getFullYear();
switch (daytext) {
case 0 :
daytext = "Sunday";
break;
case 1 :
daytext = "Monday";
break;
case 2 :
daytext = "Tuesday";
break;
case 3 :
daytext = "Wednesday";
break;
case 4 :
daytext = "Thursday";
break;
case 5 :
daytext = "Friday";
break;
case 6 :
daytext = "Saturday";
break;
}
switch (mm) {
case 0 :
mm = "Jan";
break;
case 1 :
mm = "Feb";
break;
case 2 :
mm = "Mar";
break;
case 3 :
mm = "Apr";
break;
case 4 :
mm = "May";
break;
case 5 :
mm = "Jun";
break;
case 6 :
mm = "Jul";
break;
case 7 :
mm = "Aug";
break;
case 8 :
mm = "Sep";
break;
case 9 :
mm = "Oct";
break;
case 10 :
mm = "Nov";
break;
case 11 :
mm = "Dec";
break;
}
textdate = (daytext+", "+mm+". "+dd+".");
================================================== ===========
Now problem is it should compute three days from that date with certain restrictions like (dont count Saturday and Sunday, Dec 25th, Nov, 22nd, Jan 1st)...
I have to display the date based on the above rules..
plz help
Thanks
maxarindam
Converting A Date Serial Number To A Real Date
I'm reading dates from Excel and I get this type of serial number : 37477. It's actually the number of days since 1-1-1900. Is there a function to convert that directly into a date in Flash ?
Thanks,
AS 2 Loading Simple Text W/ XML? Title, Date And Text.
Ive read a few XML tutorials and I'm having trouble with this. Basically, I want my flash file to load the most recent news article. The 3 values of each article is title, date and info. I want to write all these up in an XML file, just to keep all the articles archived (in case someone wants to see "ALL NEWS", which Ill then load through a simple html page).
For example.
<article0>
<title>Alien found on mars</title>
<date>June 12, 2020</date>
<info>Blah blah blah. see them at http://www.kirupa.com.</info>
<article0>
<article1>
<title>Rubber bands of death</title>
<date>June 19, 2020</date>
<info>Woosh!</info>
<article1>
And I'd have 3 dynamic textboxes to load the title, date and info. And it would take it from the most recent article, in this case article1.
Any help is appreciated, no clue where to start. Thanks.
Simple Syntax Issue
I have for gotton the correct syntax for this. I am inside an MC and at the end want it to tell the main timeline to proceed to the next frame. Since there are different scenes, the one I am refering to is 'main'. I have tried:
_root ("main").gotoAndStop(2);
_root.main.gotoAndStop(1);
gotoAndStop ("main", 2);
None of these seem to work....
Can anyone help me?
A Simple Syntax Issue...
Ok, in the main timeline, i declare my variable:
movie = variable;
I have a series of buttons on the screen. Each one calls a different MC (e.g., instance 'ebusiness') and also assigns the value of that MC to the variable:
on (press) {
_root.ebusiness.play();
_root.movie = _root.ebusiness;
}
The MC plays normally. I have a general button outside on the main timline which closes whatever MC is open at the time, but this part does not seem to work too well:
on (press) {
_root.movie.play();
}
The 'play' is suppoed to get the MC to continue from it's internal 'Stop' command and it closes itself.
What am I doing wrong?
Sound Issue (simple)
I shouldn't be having this much trouble because I have great tutorial to explain, but yet I must still be doing something wrong.
take a look please, I need the mp3 to stop at frame 520, or near there depending on where in the movie exactly I want the sound to stop. Also, automatically fade the sound near the 520 frame mark would be helpful. THank-you in advance.
-=Simple Synax Issue=-
Whats the proper way to use the return command with a one-line conditional phrase?
(CheckIfTrue) ? return 0 : return 1
This will not evaluate properly. What do I need to do ... ASIDE from moving to IF conditional styles -_-.
~Brad
Simple Link Issue
Here is the situation:
I have a webpage. at the top of that page is a flash banner. On that flash banner I have a button. I want people to be able to click on that button and have the page switch to another page.
I'm not doing something right:
I click on the button and click on the get url action below. it adds "getURL();" to the code but that's it. obviously there is more to getting a link added to a button. Please tell me how I can add a link properly and publish it so that it will work when I add the flash banner to my page.
NOTE: I am not using a frameset. I dont want to open up a new window. I want the URL to load into the same page.
Thank you to anyone that helps me out!
Simple Script Issue
i have attatched a simple script to a button to make a menu bar fade up when i rollover it.
the problem is, every time i rollover the button the script starts again and the menu fades in every time.
can i make the action to only work once?
Regards,
Marcus...
Another Simple Button Issue
I have 4 pictures as buttons, I want them all to goto different scenes...the first scene is only 1 frame, with all the pictures. I want to beable to click each picture to goto a different scenes with more pictures, writing, etc. A little stuck on the codes though...any help?
A Simple Issue Of Delay
This may be a very very simple thing to do, but my searching has been spotty - most likely because I don't know how to word the question...
I'm attempting my first site (oh good, a newbie...)
and I just need to configure a button that performs three actions. However, the actions should do this:
On button click (mouse release) -
*load 1st movie into layer 3
*Pause for 15 frames
*Load 2nd movie onto layer 2(hidden by movie 1)
*Unload movie 1 on layer 3 (unhiding movie 2)
I guess my question is... can an actionscript be easily designed that can do an action, pause for a duration, then do another...etc...?
Thanks!
- TF
Simple Combobox Issue?
I have a simple combobox that just loads a URL. In testing in a blank doc 1 frame, 1 layer, it works great. When I try to add this to a current movie, I get the following errors, I have attached the script and the errors. Please help....
Script:
on (change) {
// trace("I selected: " + this.getValue() );
my_url = this.getValue()
if (my_url != "") {
getURL(my_url);
}
}
Error:
**Error** Scene=Scene 1, layer=Layer 37, frame=1:Line 1: Invalid mouse event specified.
on (change) {
**Error** Scene=Scene 1, layer=Layer 37, frame=1:Line 3: Statement must appear within on/onClipEvent handler
my_url = this.getValue()
**Error** Scene=Scene 1, layer=Layer 37, frame=1:Line 4: Statement must appear within on/onClipEvent handler
if (my_url != "") {
**Error** Scene=Scene 1, layer=Layer 37, frame=1:Line 7: Unexpected '}' encountered
}
Total ActionScript Errors: 4 Reported Errors: 4
I would do this any other way possible. I just need a pulldown that take users to a URL.
Thanks in advance.....
Simple Syntax Issue I Think....
making a basic coloring book,
the paint brush is coloring just fine, but the target areas are not.
any help on how to write this?
code:
startDrag(_root.paintbrush, true);
_global.chosencolor = 0x000000
myColor = new Color(_root.paintbrush.paintbrushColor);
_root.black.onRelease = function() {
myColor.setRGB(0x000000);
chosencolor = 0x000000
};
_root.blue.onRelease = function() {
myColor.setRGB(0x3300ff);
chosencolor = 0x3300ff
};
_root.green.onRelease = function() {
myColor.setRGB(0x33ff00);
chosencolor = 0x33ff00
};
_root.red.onRelease = function() {
myColor.setRGB(0xcc3300);
chosencolor = 0xcc3300
};
_root.area1.onRelease = function() {
area1.setRGB(chosencolor);
};
_root.area2.onRelease = function() {
area2.setRGB(chosencolor);
trace(chosencolor)
};
Simple Popup Issue
I have this action for my popup's:
on (release) {
getURL ("javascript:NewWindow=window.open('pords.html','F orm','width=550,height=300,left=0,top=0,toolbar=No ,location=No,scrollbars=yes,status=No,resizable=No ,fullscreen=No'); NewWindow.focus(); void(0);");
}
I want it to pop up in the center of the screen not the top left, what do I need to change for this to happen?
Thanks
Simple Preloader Issue
I'm trying to make a preloader for my project. I've done a few tutorials but the same thign keeps happening. When I preview the movie, it keeps flashing, like a constantly refreshing browser kind of thing. I got my current AS from here Preloader is on the first scene. Any ideas?
Attachment .fla is too big (700kb) but download it at:
http://www.theautumnrun.com/preload_issue.fla
Flash MX 2004
AS 2.0
Thank you for your help in advance.
Simple Preloader Issue
Okay, I've tried several different preloaders including the one that comes as a component with Flash MX 2004 pro. My problem is that the preloader doesn't show on the screen until the movie is at 64% loaded. There is nothing but the preloader and it's code in the first frame of the movie. Can anyone tell me why this is happening...or better yet, how to stop it from happening? I have a fairly large movie and it takes several seconds (10-15) to load and I don't want to lose viewers. Thanks!
New Dude-simple Issue?
Trying to get a grip on Koolmoves. I put together 4 frames, the LAST having animation. When I view the movie, the last frame does not show up. Actually, if I could ask some smart person a few questions, I'd REALLY appreciate it--I learn quick!
Simple Variable Issue
This is a simple task, but it is not working for me, thus I am forced to inquire...
-On the main timeline I can place an instance of a movie and name that instance "square"
-On the first frame of the timeline in square I can declare a variable named "cat" and assign it the value of "13"
var cat = 13;
-On the first frame of the main timeline (with the square movie instance present) I can place this code...
trace(square.cat);
And yet it will still output "undefined"
What am I doing wrong?
Thank you for your time. Best Wishes to you all,
Eric
Querystring Issue - Probably Simple
Hi all,
I've been having a real issue with one of my swf files collecting data from the querystring. I am using the Flash Satay method so my page stays xHTML compliant and have the following:
Code:
<div id="advert-top">
<object type="application/x-shockwave-flash"
data="flash/container.swf?path=flash/top_products.swf"
width="748" height="120">
<param name="movie"
value="flash/container.swf?path=flash/top_products.swf" />
<param name="wmode"
value="transparent" />
</object>
</div>
This is the code in the first frame of my container.swf:
Code:
_root.onEnterFrame=function(){
loadMovie(_root.path,0);
}
And all that is loading is the empty container.swf. HOWEVER when I cut out the querystring and hardcode the path directly into the container.swf (i.e. loadMovie("flash/top_products.swf",0) ) it seems to work fine?!
The reason I don't want to hard code it is because I am using this as a template snippet and I use PHP to substitute the website root path into the querystring (i.e. value="<?=$GLOBALS['webRoot']?>flash/top_products.swf where webRoot may be "../../" for example).
So why isn't my querystring loading into the movie?! What AM I doing here??
Thanks in advance!
Simple Addition Issue
I haven't been getting enough sleep....I CAN'T believe this has me stumped - thanks in advance for the lack of sarcasm in your help ; )
So, I have two text fields (var names myNum & myNum2 respectively) both with the number 0 in them. I then insert the simple AS "++myNum" and "++myNum2" in frame 2 and all is as it should be. The simple text fields count up forever.
Now, I want to make the addition happen from an AS in a frame of a MC - one for each of the text fields and I cannot get it to work to save my life. I can't believe it's not working....what am I missing here?
FLA File
[F8] Simple LoadMovie Issue
Hey, I made a separate swf to be the background for another movie. So I use the fallowing code to load it in:
code:
loadBg = function() {
this.createEmptyMovieClip("bg", this.getNextHighestDepth())
bg.loadMovie("images/cubes.swf", this)
bg.cacheAsBitmap = true
//tried w/ & w/o this, not sure if it works in the case?
}
It loads the movie and runs it fine with "this.onLoad = loadBg" also put at the bottom of course. Then as soon as I add another function to run, it works for about 20 seconds before grinding to a very very slow refresh rate, almost nothing. So i'm assuming it runs out of memory to work or something? Hence why I tried the cacheAsBitmap, but has a very tiny effect, if any. Any ideas how to fix this? The other movie is a graphic which has it's hue set to -180, then 359 frames later another is set w/ its hue to +180 w/ a motion tween in the middle. So I guess it is a very memory consuming process? Any ideas? Thanks, - Peter.
Simple Keypress Issue. Help
Hi i'm trying to make a pause button that is triggered by pressing the letter p. It won't work! why? Here's my code on the button:
Code:
on (keyPress "p") {
_root.pauser = true;
}
such a simple thing that is driving me nuts! Help!
Simple GotoAndStop Issue
I've got 2 scenes in my movie.
The first is the "main" mc and holds my homepage.
The second is tittled "content" and holds a single frame named "ad".
On a button inside a mc on the main scene, I use the following action script.
on (release) {
gotoAndStop("content", "ad");
}
Simple Syntax Issue
There seems to be a bit of a gap in my knowledge of AS syntax... In many of my projects in the past I've used code like this:
code: ["mc"+var]_x = 0;
to access a complexly named mc's fields. I had never tried to do the same for calling a method of such a movieclip, ie:
code: this.["mc"+var]doSomethingAwesome();
When I did try this however, Flash spits out "Expected a field name after '.' operator."
Does anyone know how to do this?
LoadMovie Issue -- Something Simple
My brain is just GONE over this one, and I know it must be simple.
I have a movie inside of a button. I am trying to load an external .jpg into the movie.
The button is on the root and the instance name is "photo1"
The movie inside the button's instance name is "thumb"
And here's the code I'm using:
Code:
photo1.thumb.loadMovie ("photo01.jpg");
What I doing wrong? Please help. Thanks.
[F8] Simple Script Issue
Code:
on(release){
if(_root.system.command = "/openfile/v2-rocket"){
v2._visible = true;
} else {
_root.system.command = "/openfile/WrongCommand";
v2._visible = false;
}
}
Anyone see an error with this script?
It seems to be ignoring the if command, and makes "v2" visible if the if command is correct or not.
Button Issue...really Simple
I cannot get a button within an MC on my stage to respond. The MC is 'togglemenu" and the button is 'next_btn'. What am I doing wrong? This is the code:
Code:
togglemenu.next_btn.onRelease = function() {
trace("check next");
};
Simple Swf Interaction Issue
Hi,
I've been spinning my wheels here for way too long about what should be a very simple thing, but nonetheless I'm sending out the Mayday. This is my first attempt at having multiple swfs in one project, and I can't seem to get them to communicate.
I have a swf (swf A) file which loads another swf file at runtime (swf B). They are both in the same directory. The swf (swfB) loads without any problems, and when it does (on the COMPLETE event ) I assign it as a public var in the document class of parent swf (A) like this:
in the parent class:
Code:
public var swfB:MovieClip;
// loading code
.
.
.
.
public function swfBLoaded:Event):void{
swfB = e.currentTarget.content;
}
All this seems to work fine. When debugging, I can see swfB has loaded in the debug panel.
I have a class in the parent (swfA) which is supposed to display the child (swfB) on a button press, but addChild(parent.swfB) in that class gets me this error:
1119: Access of possibly undefined property swfB through a reference with static type flash.displayisplayObjectContainer.
Now, swfB is not undefined, and it is not private, so what's the problem ?
Like I said, I can see it in the debug panel, and I have the path correct, but I must be missing something about swf interaction because it doesn't work the way I expected.
I'm really stuck here, and any help would be appreciated. Thanks in advance.
|