ActionScript 3.0 :: TextIndent Property In StyleSheet Class?

Apr 30, 2010

Code:
import flash.text.StyleSheet;
var ss:StyleSheet = new StyleSheet();
ss.parseCSS("p{fontSize: 10; textIndent:50;}h1{fontSize:15;}");

styleMe.styleSheet = ss;
styleMe.htmlText = "<p>Title for my text</p> <p>This is my text with whom I am so proud and happy and this is my text which I am so proud and happy.</p>";
I just knocked up a very quick test for styling in a TextField using CSS, and as you can see from the result, the second paragraph is completely ignoring the textIndent value.It doesn't seem to make any difference if I use a h1 or a p for the title, the second paragraph still has a mind of it's own when it comes to textIndent.

View 8 Replies


Similar Posts:


ActionScript 3.0 :: When Apply A StyleSheet With The Img Tag Having The Display Property Set To None - It Doesn't Appear To Work

Jan 6, 2010

I have a TextField that has been populated with html text, which includes images using the <img> tag. I don't want to display these images to the user, however when I apply a StyleSheet with the img tag having the display property set to none, it doesn't appear to work.

View 1 Replies

ActionScript 2.0 :: Error - The Name Of This Class - 'TextField.StyleSheet', Conflicts With The Name Of An

Aug 10, 2009

i was trying to make a simple analog clock flash but when i try to make a new Date() line that pops:
**Error** C:Documents and SettingsUserLocal SettingsApplication DataMacromediaFlash enConfigurationClassesFP8TextFieldStyleShee t.as: Line 7: The name of this class, 'TextField.StyleSheet', conflicts with the name of another class that was loaded, 'TextField.StyleSheet'.{Total ActionScript Errors: 1 Reported Errors: 14 and i tried to make that the only action on a different project it still shows exactly the same thing

View 9 Replies

ActionScript 3.0 :: Get Stylesheet Loaded - Keep Getting "1120: Access Of Undefined Property"?

Nov 28, 2009

I have been trying to get my style sheet to load for 3 days now and I have to say I am at my wits end, does not help that I am a newbie. I have built a flash site at[url].....

I have an action script (3.0) that when you click on a link it calls content to slide in from the left and then clicking on another link the old content slides off and the new content slides in. I have been trying to get style sheets working with my xml which are now working in the editor but I cannot get my style sheet to load in Flash CS4 and Action Script 3. I could not figure out where to put the css code in the action script so have been loading it separately on frame 1 in my movie.I keep getting "1120: Access of undefined property" My code is

//init TextArea component
mover_mc.html = true;
mover_mc.wordWrap = true;[code]..........

To make this a little more complicated I have a layer called content which contains a movie clip called mover_mc and inside this I have a textfield called myText. This is set to be dynamic and multiline. My stylesheet is called sample.css.I load up to mover_mc or the actual text field and when I see examples that have MyCSS do I change this to the name of my style sheet.If I change the stylesheet object to

//Create a new style sheet object
var sample = new myText.StyleSheet();
var sample.load("sample.css");
myText.styleSheet = sample;

I then get an error - 1086: Syntax error: expecting semicolon before dot. I have attached my XML action script, CSS file and one of my xml files as well.

Attachments:
home.xml (612 bytes)
sample.css (653 bytes)
Content.as.zip (1.0 K)

View 4 Replies

Flex :: Binding - Bind Property Of View To Property Of Class Using MATE?

Jan 9, 2011

Lately i discovered MATE (for Flex development) and was wondering: how do i bind a property in a view (actually a navigatorcontent component) to another property in a class so that they stay in synchronization (meaning that whenever the property in the class changes the property in the view also changes).

So if we have a view called Target.mxml and a property targertProp how do we bind it to the class called SourceClass with property SourceProp?

View 3 Replies

Flash :: Access Object Property Or Function On Extended Class That Isn't In The Super Class?

Jan 29, 2012

If I have three classes:

public class Example {
public function Example () {
}[code]............

You can see that the two last classes extend the first one, and both have the 'variable' property. In case that I have an instance of Example and I am sure it is also an ExtendedExample OR AnotherExtendedExample instance, is there some way to access the 'variable' property? Something like

function functionThatReceivesAnExtendedExample (ex:Example):void {
if(some condition that I may need) {
ex.func()

View 3 Replies

Actionscript 3 :: Access A Public Property From AvEniroments Class Through The Player Class?

Nov 24, 2011

I have the following inheritance structure:

var environment:AvEnvironment = new AvEnvironment(...);
addChild(environment);
environment.addChild(new Terrain());
environment.addChild(new Player());

I am trying to access a public property from AvEniroments class through the Player class, however I'm getting an undefined property error (#119). I've tried the following:

this.x = AvEnvironment.xs // public property in this class
this.x = parent.xs

I've also tried something like this:

var ev:AvEnvironment = AvEnvironment(parent);
this.x = ev.xs

but I get a TypeError. Error #1009: Cannot access a property or method of a null object reference.

View 1 Replies

Flex :: Unable To Bind To Property 'xmlnode' On Class 'XML' (class Is Not An IEventDispatcher)

Mar 14, 2012

i am using xmllistcollection for displaying data in list. whenever i run my application data is display in list control, but this warning has displayed in console. How can i remove this warning warning: unable to bind to property 'xmlnode' on class 'XML' (class is not an IEventDispatcher)

View 1 Replies

Flex :: Binding To A Base Class Property With Class Inheritance?

Feb 9, 2010

say that i have a base class called Base, that is Bindable and has a String property like this:

[Bindable]
public class Base
{
public var msg:String;

[Code]......

where msg is some textInput field. I am getting a message from the compiler that....

Data binding will not be able to detect assignments to "msg"

is there a limitation with data binding to a base class?

View 1 Replies

ActionScript 2.0 :: Referring To A Class Property - Get The Id Form The Piece Class

Jan 9, 2009

I have a class that looks like this:

[Code]....

now when i try to get the id form the Piece class like this it doesn't work, i've been looking at this for the better part of the past hour! what am i doing wrong?

ActionScript Code:
var player1:Player = new Player("eddie");
player1.setPieces();
trace(player1.pieces[0].id);///why is this not working! getting undefined!
// i tried datacasting i get null
trace(Piece(player1.pieces[0].id));

View 6 Replies

ActionScript 3.0 :: Access The Stage Property From A Different Class That's Not The Principal Class?

Jul 2, 2009

I was wondering how do you access the stage property from a different class that's not the principal class tied to the fla? Essentially, I have main.as which calls another class menu.as, and I can't seem to be able to use the stage.stageWidth property from menu.as. What's the proper way to be able to use the stage property from any class? Do I have to import it separately each time?

View 2 Replies

Actionscript 3 :: Use The Class Datatype To Make A Class A Property?

Jan 9, 2011

can I use the Class datatype to make a class a property, then create new objects from that class? Like so:

class Foo{
private var ExampleClass:Class;
public function Foo(exampleClass:Class){

[Code]....

View 1 Replies

ActionScript 3.0 :: Accessing A Class Property Through Document Class?

Sep 3, 2009

I have a document class that looks like this:

Code:
package
{
import Map;

[Code]....

Is it possible to access a property of the Map class (though map defined in the Document class) from within the hero class?

View 4 Replies

ActionScript 3.0 :: Accessing Document Class Property From Another Class

Feb 28, 2010

The Main.as file will have all of the game logic, such as the mysteryNumber.

The other actionScript files represent rooms that the user may click and depending on the 'mysteryNumber', it will execute the 1 of 6 scenarios.

So for example, if a user clicks the Library page, the LibPage.as will call the 'mysteryNumber' and execute some code to display on the library page.

It will be the same for the other 4 rooms.

The problem I have is that the LibPage.as won't call the 'theNumber' property from Main.as

Here's the Main.as

Code:
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;

[Code]....

View 3 Replies

Actionscript 3 :: Returning A Property Of A Class Rather Than The Class Itself

Nov 30, 2011

In ActionScript 3, there are some classes that will represent a value rather than the class itself. It's hard to explain properly what I mean, so take this example:

[Code]...

View 2 Replies

Xml :: Loading Into A Class' Property?

Jan 10, 2010

This seems like it should be an easy one but I can't figure it out.I'm trying out a very simple class that, when created, loads and XML file into the class's property. I must be getting a basic concept tangled up here because I can see the XML coming in just fine in the handleComplete function, but the class property _result remains empty.What concept am I missing here?

public class MyClass
{
private var _result;

[code].....

View 1 Replies

ActionScript 3.0 :: Using Property Of MC In Another Class?

Feb 4, 2009

I want to accomplish simply that MC 'Menue' follows MC 'SliderLeftVert_Panel'. I don't get it.I get this error: TypeError: Error #1009: Cannot access a property or method of a null object reference at SliderSlide/Move()

The MC 'SliderLeftVert_Panel' is linked to Class 'SliderSlide.as' below

package {
import flash.display.*;
import flash.events.*;[code]...........

I want to accomplish simply that MC 'Menue' follows MC 'SliderLeftVert_Panel'. I don't get it.

View 2 Replies

Actionscript 3 :: Returning A Property Rather Than The Class Itself?

Feb 15, 2012

I can use toString() to return any string desired when using trace(instance), is it possible to return other types of objects?For example, I may have this class:

public class List
{
private var _content:Array = [];
public function add():void{}
public function remove():void{}
}

I normally need to make a getter that returns the _content, eg:

public function get content():Array{ return _content; }

So that I can do things like:

for each(var i:Object in myList.content)

Can I make myList in the above case actually return the value of content automatically? So that I can do like:

trace(myList); // item, item, item (similar output as tracing an array)
for each(var i:Object in myList)

View 1 Replies

ActionScript 3.0 :: Access MC Property From Class?

Sep 17, 2010

I have one class which is assigned to dropBar MC:

ActionScript Code:
import src.DropDown;
var inheritanceDrop:DropDown = new DropDown(dropBar, 1);

[code].....

View 5 Replies

ActionScript 2.0 :: Class Instance Name Property?

Aug 28, 2007

is there any way, within a class definition, to access the instance name of the class?as in, say you have a class "playerObject", and you instantiate an instance of it like usualplayer:playerObject = new playerObject();is there an inbuilt property or variable i can access within the playerObject class code to return "player"?if, in the constructor, i trace(this) it returns [object Object], i tried things like this.name, this._name etc, of course they didnt work...

View 4 Replies

ActionScript 3.0 :: Get A Property Value From An Instantiated Class?

Jun 15, 2011

Im trying to get the value of the textWidth property in class Main from a text field created in an instantiated class Label. When I trace the value from within the Label class I have access to the values. I'm trying to use a get function to pass the value to the main class.[code]

View 3 Replies

ActionScript 3.0 :: Create A Custom Class That Extends The MovieClip Class And Contains A Custom Property Of "marker"

Jan 23, 2010

I am new to AS3, as well as Flash in general, so forgive me if this seems highly elementary. All I am trying to do is create a custom class that extends the MovieClip class and contains a custom property of "marker". I want to be able to use and change the value of this custom property on the timeline for an instance of this class and have it behave just like any other (Ex: this.x ==> this.marker).

[Code].....

View 13 Replies

ActionScript 3.0 :: Tweener To Tween Property Of Class

Aug 25, 2009

I've got a property, var angleX:Number; declared right after my class declaration (therefore available to each function in the class). How do I go about tweening this value with Tweener? Specifically, I'm trying to do it in a mouse press event but am stumped by the object i need to pass - the keyword "this" isn't working.

[Code]....

View 2 Replies

ActionScript 3.0 :: Access A Class Instance Property?

Jan 15, 2010

I have a problem with the piece of code that's been annoying me for a week. It should be very simple but all my attempts at a solution somehow seem to get thwarted by an invisible hand that wants me to fail.Here is the scenario: I am trying to create an image strip consisting of image thumbnails. When one mousovers each image it should print its information (say a name) in a textfield.I created an image container class that loads the images through a url request, then an image strip class that receives an array with image names and urls and displays them in a row. So far so good.

However when it comes to showing the info I have no clue how to address which image is being pointed at. I put a variable called imageIndex inside my imageContainer object, then put all the created containers in imageStrip's for-loop inside an array called mgContainerArray. I created a for loop in my fla that goes through this array and assigns all those containers a mouseover event listener. What I'm stumped with is that there is no way I can access the imageIndex variable from my function to tell the code which image is currently being mouseovered. It keeps giving me an error.Here is the code:

Code:
for(var i:Number=0; i<myImageStrip.imgContainerArray.length;i++){
myImageStrip.imgContainerArray[i].addEventListener(MouseEvent.MOUSE_OVER,

[code].....

View 3 Replies

ActionScript 3.0 :: Class Property Error #1013

May 8, 2010

I'm customizing a floating panel that I found on gotoAndLearn.

View 2 Replies

ActionScript 3.0 :: Adding Property To MovieClip Class?

Mar 20, 2009

I am not sure if this is possible, but can I add a custom property to the MovieClip class. I'd like to add a tooltip-functionality to some things so I'd just need a "tip"-property in which I can store a String. Would this work, or do I have to create a new Class extending MovieClip?

View 2 Replies

Flex :: Get A Static Property From Class In Actionscript

Jul 15, 2010

I have this class

package somePackage
{
public class SomeClass

[Code]...

I want to be able to get those static property given it's name.

Example:

public static function getProperty(propertyName: String): SomeClass {
//don't know what goes here
}

[Code].....

View 1 Replies

Php :: Error Using PHP Class <b>Notice</b>: Undefined Property?

Mar 30, 2011

I have a flash file that passes some variables to a php script and creates a zip file of a group of jpg files. When I had all of the code in one php file everything worked fine. Now I wanted to separate out the script into two files. One php file that gets the variables and a class that would actually do the work of creating the file. However I am getting this error when I run it.

<br />
<b>Notice</b>: Undefined property: ZipTestClass::$FileName.zip in <b>F:Web Page mcwphoto43TestZipArrayipTestClass.php</b> on line <b>15</b><br />[code]...............

View 3 Replies

Actionscript 3 :: Property Introspection Within A Class In Flex

Jan 21, 2012

Im bulding a class that has a bunch of properties, and looks something like this:[code]This compiles fine, but doesn't print anything. When i step through it, it seems to skip over the loop, as if "this" doesn't have any properties.

View 2 Replies

Actionscript 3 :: Access A Property/method From Another Class?

Mar 14, 2012

I want to create an array of strings in a text class that I can access with the main document class. Then I'll be able to populate a text field with items in the array. The purpose of this is to avoid having massive lines of text in my main document... but I can't even get my test to work. The compiler is telling me that the array (txt1) is undefined. First here's my code for the array:

//text array class:format5000
package {
import flash.display.MovieClip;
import flash.text.*;

[Code].....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved