Accessing field inside a block I have created a block to display flash content. All it needs a a variable to be assigned dynamically from the content to flashVar. I created a field called myfile path in the custom content type. Which is just a text pointing to the path of file. I also created a block and below is the code inside the block.

&lt;?php
$myFilePath = field_get_items('node', $node, 'field_myfilepath');
?&gt;

&lt;script src="/player/swfobject.js"&gt;&lt;/script&gt;
&lt;script&gt;
        function swfDimensions(width,height)
        {
           document.getElementById('altContent').style.width=width+'px';
           document.getElementById("altContent").style.height=height+'px';
        }
        var flashvars = {
                    filepath:"&lt;?php echo $myFilePath;?&gt;" // this where I use the filed value which my flash app uses internally

        };
        var params = {
            menu: "false",
            scale: "noScale",
            allowFullscreen: "true",
            allowScriptAccess: "always",
            bgcolor: "",
            wmode: "direct" // can cause issues with FP settings &amp; webcam
        };
        var attributes = {
            id:"altContent"
        };
        swfobject.embedSWF(
            "/player/contentviewer.swf", 
            "altContent", "640px", "390px", "11.3.0",
            "/player/expressInstall.swf",
            flashvars, params, attributes);
    &lt;/script&gt;
        &lt;h4&gt;Floorplan Basic&lt;/h1&gt;

    &lt;div id="altContent"&gt;
                To view this content you need Adobe flash player (v11+) plug-in installed on your browser
        &lt;p&gt;&lt;a href="http://www.adobe.com/go/getflashplayer"&gt;Get Adobe Flash player&lt;/a&gt;&lt;/p&gt;
    &lt;/div&gt;


I am getting this error

EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7663 of C:\...\www\includes\common.inc).


Can any on tell me how to get the value of the field in this block? I am totally new to drupal.
I guess $node is not defined. You should know when a node page is shown. Then get the node id using arg(1). Load the node object and then use.