Basic Actionscript Trouble in CS3
In MX, and in Flash 8 I had no problems with making buttons
and putting some basic actionscipt on it. In CS3 for some reason
when I make a button, look in the properties window and the button
windows there (which tells me I'm on the buttons layer) but when I
go to put the actionscipt in, it doesnt allow it. It says "Cannot
add actionscript because blah blah". It only allows it with the
frame, not the button if that makes any sence. Why is this?
Ok, will try. However I tried that one I think. I changed it
to AS2 (not from the beginning). So basiclly open a new Flash FLA
and how do I make it ONLY go to AS2? Thanks
Similar Messages
-
Basic Actionscript 3.0 OOP Confusion
I'm having a difficult time getting basic Actionscript OOP
principles to work in my code. I have an application I'm building
that extends the Sprite object. I try to instantiate another Sprite
object, and specify the with/height/x/y values to size this new
object, but it never properly sets these values. If I trace the
width/height, etc. they're always equal to 0. I'm not exactly sure
what I'm doing wrong.
The 3 different sizing syntax I've tried are:
graphics.drawRect(0,0,width,height); // DOES NOT WORK
graphics.drawRect(0,0,parent.width,parent.height); // WORKS
graphics.drawRect(0,0,600,400); // WORKS
Code is posted below:
package {
import flash.display.Sprite;
import flash.display.Stage;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import ChartPanel;
public class Chart extends Sprite
private var chartType:int;
private var chartPanel:ChartPanel;
public function Chart()
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
graphics.beginFill(0xffffff);
graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);
// Fill BG as White
graphics.endFill();
chartPanel = new ChartPanel();
chartPanel.setDimensions(600, 400, 0, 0);
addChild(chartPanel);
chartPanel.draw();
package
import flash.display.Sprite;
public class ChartPanel extends Sprite
public function ChartPanel() {}
public function setDimensions(w:int, h:int, off_l:int,
off_t:int):void
this.width = stage.width;
this.height = stage.height;
this.x = off_l;
this.y = off_t;
public function draw():void
trace("DRAWING: this.width=" + this.width + " this.height="
+ this.height + " this.x=" + this.x + " this.y=" + this.y);
graphics.beginFill(0x0000ff);
// DOES NOT WORK graphics.drawRect(0,0,width,height);
graphics.drawRect(0,0,parent.width,parent.height);
graphics.endFill();well... you still don't grab the hole width and height
concept, as I told you they are MEASURES not fixed variables, so by
setting a width and a height you are not defining a biding
rectangle with content in ti, the Sprite class simple doesn't have
the code for that, the Sprite is simply an elements with things in
it, now actual border or frame.
For what you want you'll still need your invisible rectangle,
but it will have to be a MASK of the sprite class.
As for the code (NOTE I'M JUST WRITING HERE SO IT CAN HAVE
SOME BUGS) it should be something like this:
public class Box extends Sprite {
private var border:Shape;
private var _width:Number = 100;
private var _height:Number = 100;
public function Box() {
border = new Shape();
addChild(border);
mask = border;
drawDispArea();
private function drawDispArea():void {
border.graphics.clear();
border.graphics.beginFill(0xFF0000);
border.drawRect(0, 0, width, height);
override public function set width(v:Number):void {
_width = v;
drawDispArea();
override public function get width():Number {
return _width;
override public function set height(v:Number):void {
_height = v;
drawDispArea();
override public function get height():Number {
return _height;
} -
Help! Trouble installing CS3 Design Premium
I have trouble installing CS3 Design Premium. I am using Windows XP. I had to deinstall CS3 after my PC had a little crash. Now I want to install CS3 again. But at the beginning there comes an error message "Setup is already running. You can install only ONE adobe product at the same time. Shut the other installation before starting the installation of CS3."
The point is, there is NO OTHER installation running at the moment - so far as I know.
I tried already the following, but there was the same error message:
- to start the installation by another user
- to start it from the protected mode.
- to start it by desktop installation.
Please, can anybody help me??
Thanks a lot!!!!
Nilo
Message was edited by: Nilorak123Try this:
http://www.adobe.com/support/contact/cs5clean.html
Bob -
Hi folks,
Ronny's here again on forums, having particularly 2 (two) questions/problems to resolve:
1) Countdown Timer to the designated Date for Live-Broadcast-Event yet to take place
2) Detect End of Live Stream on FLVPlayback with FLVPlayback.isLive = true
attached is the .zip file (as3_Countdown Timer_ver 1.0.1_by Ronny Depp.zip) with all flash source files containing:
a) The FLash Source (file: timer_module.fla) - (FLA flash source file - Flash CS3 Professional, Flash Player 9, actionscript 3.0)
b) com.othenticmedia.utils.dateAndTimeManagement package including 2 .as actionscript 3.0 Class files.
i) com.othenticmedia.utils.dateAndTimeManagement.DateAndTimeManager Class in the said package. (file: DateAndTimeManager.as)
ii) com.othenticmedia.utils.dateAndTimeManagement.CountdownTimer Class in the package. (file: CountdownTimer.as)
c) The compiled SWF file version of this Application's blueprint. (file: timer_module.swf).
What i need to confirm is: ........................................................ see the next post of mine. (for Problems need to be Resolved)Problems to Resolve:
Problem#1) - Countdown Timer to the designated Date for Live-Broadcast-Event yet to take place.
Problem#2) - Detect End of Live Stream on FLVPlayback with FLVPlayback.isLive = true;
Problem#1 Description:
I need to pinpoint the Logical TimeSync Exception, i am still unable to figure out. That is I'm using a webservice in my Application to Synchronize the Time with the actual ET (eastern time) with accomodation of auto-adjustment for EDT GMT-4 (eastern daylight time) & EST GMT-5 (eastern standard time), times. I am using the zipcode: "10012" to pass it to the Web Service in urlRequest object, to retrieve the Current ET eastern time according to EDT & EST time settings for Manhattan/Brooklyn areas or others within New York, NY 10012.
Currently the Web Service is returning accurate date/time based on local EDT GMT-4 daylight time.
Is there some defined set of dates for EDT & EST times for New York region that I can check for to ensure the correct Dates/Times for Eastern Time in New York area ??? I am using NY zipcodes because i am sure to get correct ET values.
The Major Problem Part: is I need to correct the time by 2 seconds or approx. 2 secs, some millisecs.
When I retrieve the Time Value from WebService, it lags behind for 2 seconds as compared to DateObj i create using computer's local time, on my Windows XP Service Pack 2 with Automatic Updates turned-on. And I'm sure about my Windows will be having latest updates for Time Management already installed. I also added the 2 secs. to the TimeSync(ed) Date to make correction to this Date obj.
I call my custom fucntion addSeconds(dateObj:Date, secs:int) to add 2 seconds to the Date by Converting Seconds to Milliseconds.
Please comb through the as code in files attached and Help Me Out !!!
Problem#2 Description:
Secondly I need to Detect the End of Stream state while using FLVPlayback component, an rtmp:// live Stream from FLASH MEDIA SERVER.
I need to Play a YuMe Post-Roll Ad when Steam Finishes/Ends.
Live Broadcast Stream Event starts every night on Wednesdays & Saturdays exactly at 10:59 PM EDT GMT-4.
Live Events only Streams/Broadcasts the stream for 50secs. exactly. When [playback stopped] it plays a PostRoll Ad and after the CountdownTimer again comes back to life. The Next upcoming Event is calculated & the Countdown begins until Next Event's time/date is reached.
Here is the code on the frame 1 on the MainTimeline: (rest of the params like source, volume, skinAutoHide are Set using Property Inspector for FLVPlayback instance on Stage)
//myStream instance of FLVPlayback is on the Stage
myStream.isLive = true;// Frame 1 Actions in the FLA
myStream.addEventListener(VideoEvent.COMPLETE, onEndOfStream);
myStream.addEventListener(VideoEvent.STATE_CHANGE, onState);
myStream.addEventListener(String(VideoError.NO_CONNECTION), onStreamError);
myStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
/*if(myStream.stopped){
trace("tracy: "+myStream.state);
} else if(myStream.state == VideoState.STOPPED){
trace("tracy: "+myStream.state);
function onStreamError(event:VideoError) {
trace(event.code + "\n\t" + event);
function onState(event:VideoEvent) {
trace(event.state + "\n\t" + event.toString());
function onEndOfStream(event:VideoEvent) {
trace(event.state + "\n\t" + event.toString());
function netStatusHandler(event:NetStatusEvent):void {
switch (event.info.code) {
case "NetConnection.Connect.Success":
//connectStream();
break;
case "NetStream.Play.StreamNotFound":
trace("Stream not found: "/* + myStream.source*/);
break; -
Very Basic actionscript question
Hi,
This is very basic but for some reason cant get it to work.
Basically I have a movie that plays and at the end I have a button that comes on screen but once the button stops I want the user to press the button then it goes to the url.
I have
stop() {
on (release) {
getURL("http://google.co.uk","_self","blank");
but this doesnt work.
Thankyou for any help.I have now sorted it, I had my movie on actionscript 3 and needed to put the url code onto the actual button.
-
Forgive me, I'm really new to this.
Ok, so I'm wanting to have ads radomly play before people watch a video on my site.Is there a way to write the script for this and place it in the xml or do I have to something differently.
I already have the video up on our site. So I'm just not sure how I "connect" the actionscript and xml that way it plays the commercial before the video.
Do I have to build a new player and everything to do this? I've never built a player before, so if I don't have to, I'd rather not. Thanks.This is not a basic question but rather extensive topic.
Yes, there are ways to connect anything to XMLs. But you have to write your own application/player that will contain the logic to do that.
Also, there are open source player out there that may do what you ask. -
Can I make a (simple and basic) website with Photoshop CS3?
I know there are tools in the Photoshop CS3 that can help me with web design functions such as making slices, animated gif, layer etc. But can it help me to design and create a simple and basic personal website? I don't need any fancy stuff like dynamic html or xml (maybe I will put some music files) but only basic html would be enough. I have MS Frontpage 2003, which can help me to create a website with no problem at all but I like the slices and layers idea on the Photoshop. Plus sometimes a website that was created by Frontpage will not look the same or work properly in Firfox, which is the browser that I use all the time. I wish I could have Dreamweaver CS3 but it is too expensive for me. Any advice would be greatly appreciated!
p.s. If the answer is no, then I would start using Frontpage to help me with that.Forget FrontPage. Forget you ever even heard of it.
Check out the FREE and very full-featured NVU website building app:
http://nvudev.com/index.php -
Basic actionscript help, tracing properties of my class object
Hi all,I'm just starting to learn about classes in actionscript, I am following along with Moocks book Actionscript for Flash MX and are trying to execute a trace on the properties of my ballclass but all I get is undefined. He is what I have in my actions panel.
function Ball () {
this.radius = 10;
this.color = 0xFF0000;
this.xPosition = 59;
this.yPosition = 15;
var boucyBall = new Ball();
trace (bouncyBall.radius);
trace (bouncyBall.color);
trace (bouncyBall.xPosition);
trace (bouncyBall.yPosition);
Any help would be greatSince you are learning about classes, you might want to use one to help you:
class Util{
public function Util(){
// empty constructor because you don't need one for this kind of class
public static function traceProps(obj:Object,label:String):Void{
if(label != undefined){
trace(Properties for "+label+":");
for(var a in obj){
trace(" "+a+": "+obj[a]);
trace(newline);
Then place that class file somewhere in your class path so it will always be available to you. And then you can always add these lines.
import com.complexity.Utils;
If the file is in your class path you don't really need the above line, but it will help you remember that you are using it. Also I'm just making up what your class path might be based upon your screen name. You would need to use whatever actual path you had. And then...
Utils.traceProps(bouncyBall,"trouble maker here");
Of course don't use it with an 10,000 element array, unless you really like to suffer.....
or just
Utils.traceProps(bouncyBall); -
i confess, i am a newbie. i have been working with a
template, modifying it to my needs. i have ran into an actionscript
code that i cant seem to find the reference to in the books. it is:
_root.G
can someone point me toward the proper reference material to
read up on this?
thanks!Basically the "_root" part of the script references your main
timeline. Meaning your not inside a symbol but you are working
directly on the main timeline. So what you are probably doing here
is referencing a movie clip on the main timeline with the instance
name "G".
For example, if I wanted to tell a movie clip named G sitting
on my main timeline to start playing from frame label startHere I
would write the following code:
_root.G.gotoAndPlay("startHere"); -
I have tried every trouble shooting step there is. restarting my computer amd restarting my device. It died while i was at work and when i went to plug it into my car charger all i saw was the apple logo coming and going. so when i got home i put it in recovery mode and tried to restore and I got Error 2001. I have no idea what to do.
Visit an Authorized Apple Service Provider or Apple Store to get it checked. If they can't fix this, you'll have to pay the Out-Of-Warranty-Service fee to get a new replacement for a reduced price:
Out-of-warranty repair service
If your repair isn’t covered by Apple’s One Year Limited Warranty, AppleCare+, or AppleCare Protection Plan, your iPhone might be eligible for out-of-warranty service. For example, liquid damage isn’t covered by warranty but might be eligible for out-of-warranty service. Some damage isn’t eligible at all, for example if your device has been broken into multiple pieces. See Apple’s Repair Terms and Conditions for complete details.
Read Apple’s Repair Terms and Conditions
Model
Out-of-warranty service fee
Battery service*
iPhone 6 Plus
$329
$79
*available only if battery
fails Apple’s diagnostic test
iPhone 6
$299
iPhone 5s, iPhone 5c, iPhone 5
$269
iPhone 4s
$199
iPhone 4, iPhone 3GS, iPhone 3G,
Original iPhone
$149
Plus a $6.95 shipping fee, if required. Fees are in USD and exclude local tax. Pricing is for service through Apple. The final service fee we charge will be determined during testing and may be less than the service fee listed above. Pricing and terms vary for service through an Apple Authorized Service Provider.
copied from Service Answer Center - iPhone -
Basic question - trouble connecting iphone to macbook pro
Hi team,
I have a fairly basic one for you all. I have recently purchased a macbook pro, previously had an ibook G4.
I am connecting my iphone to the new computer and want to sync it to this machine. It is advising that once synced, all info from the old laptop will be cleared and new info added. All music, photos etc are already on the new comp so thats ok but my concern is losing my contacts..
Can anyone tell me if this is the case? I have my iphone synced with outlook contacts and i would assume they will stay on the device but what about original phone contacts including those saved to the sim?
Help appreciated!Apple really should give more options in these menus. I've had some "hold your breath and click" moments when using my iPod Touch as well.
-
Problems creating basic forms in DW CS3
Hey I'm having some real headaches here getting my form to
work in DW CS3. Take a look at
www.investix.co.uk/booking-form.html....as you can see I've got my
form all set up with all the text fields and buttons that I need
ready to go and process the form data entered by the user and then
email this form data to me.
Now here's the problem...the form code that I'm using just
won't work! Everytime I enter test data and click Submit button,
nothing happens. I have a booking confirmation page at
www.investix.co.uk/thank-you.html which I want to direct users to
once they have clicked the Submit button.
The form code I've got in DW is below.......so the 2 things I
need to figure out is first how to make this code work so I can
capture all the form data and then have it emailed to me, and
secondly to divert users to the booking confirmation page
(www.investix.co.uk/thank-you.html) once they have clicked the
Submit button.
I need to get this problem fixed asap guys (like this
weekend!), so I would greatly appreciate everyone's help on this.
Any comments on the overall quality of the website are also
welcome!
<table width="427" border="0">
<tr>
<td width="140"><span class="style24 style37
style42">
<form name="form1" method="post" action="
http://fp1.formmail.com/cgi-bin/fm192">
<input type="hidden" name="recipient"
value="[email protected]">
<input type="hidden" name="_fid" value="7T9PBG2C">
<input type="hidden" name="_pid" value="92505">
</form>
Name</span></td>
<td colspan="2"><span class="style37">
<input name="Name" type="text" id="Name" size="30" />
</span></td>
</tr>
<tr>
<td><span class="style24 style37
style42">Email</span></td>
<td colspan="2"><span class="style37">
<input name="Email" type="text" id="Email" size="30"
/>
</span></td>
</tr>
<tr>
<td><span class="style24 style37
style42">Confirm Email</span></td>
<td colspan="2"><span class="style37">
<input name="Confirm Email" type="text" id="Confirm
Email" size="30" />
</span></td>
</tr>
<tr>
<td><span class="style24 style37
style42">Telephone</span></td>
<td colspan="2"><span class="style37">
<input name="Tel" type="text" id="Tel" size="30" />
</span></td>
</tr>
<tr>
<td valign="top"><span class="style24 style37
style42">Address</span></td>
<td colspan="2">
<textarea name="Address" cols="30" rows="4"
id="Address"></textarea>
<p class="style24
style37"> </p></td>
</tr>
<tr>
<td valign="top"><span class="style24 style37
style42">I wish to attend</span></td>
<td colspan="2"><p class="style24 style42 style37
style68">
<input type="radio" name="radio" id="London Green Park
9th Jun 6.30pm" value="London Green Park 9th Jun 6.30pm" />
<label for="London Green Park 9th Jun 6.30pm">London
Green Park 9th Jun 6.30pm</label>
</p>
<p class="style24 style42 style37 style68">
<input type="radio" name="radio" id="radio" value="radio"
/>
<label for="radio">London Green Park 10th Jun
6.30pm</label>
</p>
<p class="style24 style42 style37 style68">
<input type="radio" name="radio2" id="radio2"
value="radio2" />
London Green Park 12th Jun 6.30pm </p>
<p class="style24 style42 style37 style68">
<input type="radio" name="radio3" id="radio3"
value="radio3" />
London Green Park 16th Jun 6.30pm</p>
<p class="style24 style42 style37 style68">
<input type="radio" name="radio4" id="radio4"
value="radio4" />
London Green Park 17th Jun 6.30pm </p>
<p class="style24 style37 style42">
</p></td>
</tr>
<tr>
<td><span class="style24 style42">Number of
attendees:</span></td>
<td colspan="2"><select name="Attendees"
id="Attendees">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select> </td>
</tr>
<tr>
<td rowspan="2" valign="top"><span
class="style24"><span class="style61">How did you hear
about us</span>?</span></td>
<td colspan="2"><input name="Lead" type="text"
id="Lead" value="" size="30" /></td>
</tr>
<tr>
<td width="63"><input type="submit" name="Submit
Form" id="Submit Form" value="Submit" /></td>
<td width="210"><input type="submit" name="Reset
Form" id="Reset Form" value="Reset" /></td>
</tr>
</table><form name="form1" method="post"
action="
http://fp1.formmail.com/cgi-bin/fm192">
<input type="hidden" name="recipient"
value="[email protected]">
<input type="hidden" name="_fid" value="7T9PBG2C">
the form opens and closes in ONE of the td table cells- the
other form
fields are not within that set of form tags so their info is
not sent.
> <table width="427" border="0">
move the opening form tag to before the above opening table
tag, and the
closing form tag to after that table's </table> tag.
Alan
Adobe Community Expert, dreamweaver
http://www.adobe.com/communities/experts/ -
Troubles installing cs3 Web Premium
I just got a new computer (MacBook Pro) running OS 10.6.7. I deactived my Adobe software on my old computer (an older white MacBook which is also running OS 10.6.7), downloaded CS3 Web Premium from the Adobe on-line store (where I originally purchased it) to my new computer and double clicked the Setup icon. I very briefly see a window saying "Initializing Adobe Setup..", then an installer alert window pops up saying "Setup has encountered an error and cannot continue. Contact Adobe Customer Support for assistance.
Customer Support transferred me to Installation support, which told me they no longer support CS3 installation questions.
What do I need to do to get my CS3 software running on my new computer?
Thanks,
Phil DiPastenaHi Phil,
I'm sorry you're having problems installing CS3. Your best bet would be to reprost this question over on the Mac Creative Suite forums.
Thanks,
Chris -
Trouble porting CS3 script to CS5
Hi:
I'm having difficulty porting some of my CS3 scripts over to CS5. It seems I'm having problems placing graphics in rectangles.
On the following script:
tell application "Adobe InDesign CS5"
activate
set newDoc to make document
tell newDoc
tell document preferences
set page width to 8.5
set page height to 11
end tell
make rectangle with properties {geometric bounds:{1.75, 1.5, 3.5, 4.375}, fill color:swatch "Black", fill tint:0, stroke weight:0.5, stroke color:swatch "Black", stroke tint:0, label:"ImageBox"}
set tempPDF to "Macintosh HD:Users:someuser:Desktop:temp.pdf"
tell rectangle "ImageBox"
place tempPDF
end tell
end tell
end tell
it draws the rectangle but I get an error saying it doesn't understand the "place" message.
Has something changed in how you load a graphic into a rectangle?
Thanks.
--jonHi jon,
Instead of setting the label property, set the name property. Then your script should work.
Thanks,
Ole -
How to do a simple or basic actionscript on Adobe Flash CS4? I am just having problems
I am doing my simple portfolio on Adobe Flash CS4. However when I am already looking just for the basic action scripting from the tutorial I can't determine which is the most accurate for the buttons.
Here's my sample below
the texts that were listed below are my buttons such as ABOUT, PROFILE, PRINT ADS, MAGAZINE, LOGO, PRINT, ILLUSTRATION, and DESIGN CONCEPT
I've already convert it into symbol as BUTTON and now I am ready to put a basic action script to function and transfer into another scene.
Example I want to function the ILLUSTRATION and PRINT button into Illustration and Print scene how would I do the action script about it?
Here's the example of next scenes that could be clicked from the homepage
This is the ILLUSTRATION scene
This is the PRINT scene
Please help me on how to do the action scripting by using the gotoAndPlay or anything else to function my portfolio. Thank youGive each of your buttons an instance name via the Properties panel. As an example fr coding them, let's say you named the button "about_btn" for the scene named "about" that you want it to go to. Then to have that button make your file go to the about scene, you would add the following code into a frame of the timeline where that button is (in a separate actions layer preferably). Select the frame and in the Actions panel write...
about_btn.onRelease = function(){
gotoAndStop("about", 1);
If you wanted it to play instead of stop at frame 1 of the about scene, then you would use gotoAndPlay(...) instead of gotoAndStop(...). If you intended to go to a frame other than 1, then it is best to use frame labels and specify the label instead of the frame number.
Just a word of warning, if you haven't gotten too far with the design yet, you should back away from using scenes and just build all your sections into the first scene as sections of the timeline and/or movieclips. Combining scenes with navigation can be problematic... they just don't play right. Scenes are more useful for animations that do not have navigation.
When you use just the one scene, all your gotoAndStop/Play commands only need to specify the frame... as in gotoAndStop(1);
Maybe you are looking for
-
4 min IOKit boot hang on Unibody Mac 10.5.7 - failure of Hard Drive?
I am experiencing a boot hang of 4 minutes (4 minutes of 0 activity) on the blue screen part of the boot process in OS 10.5.7. This hang happens on every boot. Inspecting the disk (with Disk Verify in Disk Util) revealed errors (incorrect volume file
-
The export operation failed to create an image file
I've been experiencing bizarre behavior when attempting to export images to my Usb-connected card reader. After reading some threads on this form, I was convinced that my reader was defective. Same problem on a brand-new reader. The specific behavior
-
I have a problem. In a recent move I have lost my FCP original disks (which isn't a huge problem since I have the software backed up) but when I copied all of my software from an old machine to my new MacBook Pro the FCP became unregistered and I can
-
Batch process Flatten Script not working?
Hi, I used to run the this.flattenPages(); in Acrobat pro 8 with no problems, Scince ive installed 9 the batch process requires the enter button to be pressed every time it processes a file??? Is there a work around for this? Im not too good with Jav
-
What I need help with is how to setup and allow different students to connect to their our Virtual Machine from home. Already I was able to setup VPN Server and connected to it outside of our Network.